[root@Node nginx-1.12.1]# nginx -V nginx version: nginx/1.12.1 built by gcc 4.4.720120313 (Red Hat 4.4.7-18) (GCC) configure arguments: --prefix=/root/devTools/nginx-1.12.1 --with-pcre=/root/workspaces/local/pcre-8.41 --with-zlib=/root/workspaces/local/zlib-1.2.8
1 2 3 4 5
cd ~/workspaces/github git clone git@github:happyfish100/fastdfs-nginx-module.git cd /workspaces/local/nginx-1.12.1 ./configure --prefix=/root/devTools/nginx-1.12.1 --with-pcre=/root/workspaces/local/pcre-8.41 --with-zlib=/root/workspaces/local/zlib-1.2.8 --add-module=/root/workspaces/github/fastdfs-nginx-module/src/ make
cd /root/devTools/nginx-1.12.1/ mv nginx nginx.bak cp /root/workspaces/local/nginx-1.12.1/objs/nginx ./
查看
1 2 3 4
[root@Node nginx-1.12.1]# nginx -V nginx version: nginx/1.12.1 built by gcc 4.4.720120313 (Red Hat 4.4.7-18) (GCC) configure arguments: --prefix=/root/devTools/nginx-1.12.1 --with-pcre=/root/workspaces/local/pcre-8.41 --with-zlib=/root/workspaces/local/zlib-1.2.8 --add-module=/root/workspaces/github/fastdfs-nginx-module/src/
安装完成
配置
配置fastdfs-nginx-module
1 2
cd ~/workspaces/github/fastdfs-nginx-module/src cd ~/workspaces/github/fastdfs-nginx-module/
按照如下进行配置,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
# FastDFS tracker_server can ocur more than once, and tracker_server format is # "host:port", host can be hostname or ip address # valid only when load_fdfs_parameters_from_tracker is true tracker_server=192.168.10.201:22122
# if the url / uri including the group name # set to false when uri like /M00/00/00/xxx # set to true when uri like ${group_name}/M00/00/00/xxx, such as group1/M00/xxx # default value is false url_have_group_name = true
# store_path#, based 0, if store_path0 not exists, it's value is base_path # the paths must be exist # must same as storage.conf store_path0=/home/data/fastdfs/storage
复制其余配置,
1 2
cd ~/workspaces/github/fastdfs/conf cp anti-steal.jpg http.conf mime.types /etc/fdfs/