安装fastdfs-nginx-module
下载地址:https://github.com/happyfish100/fastdfs-nginx-module/archive/master.zip
unzip master.zip
进入Nginx目录配置模块,我用的是相对路径,也可以改成绝对路径。如果你已安装过Nginx,make编译一下即可,如果未安装过Nginx还需要 make install
./configure --add-module=../fastdfs-nginx-module-master/src/ make
配置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
把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

测试下载

OK!
本文详细介绍了如何安装配置FastDFS与Nginx模块,包括下载、编译配置及测试等步骤,确保文件服务器正常运行。
944

被折叠的 条评论
为什么被折叠?



