centOS 6.5 Nginx集成fastDFS模块

Caleb0 2016-11-22

安装fastdfs-nginx-module

下载地址:https://github.com/happyfish100/fastdfs-nginx-module/archive/master.zip

unzip master.zip

进入Nginx目录配置模块,我用的是相对路径,也可以改成绝对路径。

./configure --add-module=../fastdfs-nginx-module-master/src/ 
make
make install

配置fastdfs-nginx-module和Nginx

cd /fastdfs-nginx-module-master/src
vim mod_fastdfs.conf

修改内容

tracker_server=192.168.92.128:22122
url_have_group_name=true
store_path0=/data/fastdfs/storage

将配置文件拷贝到/etc/fdfs下

cp mod_fastdfs.conf /etc/fdfs

把fastdfs-5.05下面的配置拷贝到/etc/fdfs/

cd /fastdfs-5.05/conf
cp anti-steal.jpg http.conf mime.types /etc/fdfs/

配置Nginx

cd /usr/local/nginx/conf
vi nginx.conf

在配置中加入

location /group1/M00 {
    root /data/fastdfs/storage/;
    ngx_fastdfs_module;
}

创建软链接

mkdir /data/fastdfs/storage/data/group1
  ln -s /data/fastdfs/storage/data /data/fastdfs/storage/data/group1/M00

启动Nginx

/usr/local/nginx/sbin/nginx

centOS 6.5 Nginx集成fastDFS模块
 

测试下载


centOS 6.5 Nginx集成fastDFS模块
 OK!

相关推荐

huhuhuemail / 0评论 2019-02-16