FastDFS 整合Nginx

需要在文件存储的storage的机器上执行此步骤 192.168.1.9

首先 https://github.com/happyfish100下载

fastdfs-nginx-module-master.zip

上传到服务器中 我存放的位置为 /usr/local/software

cd /usr/local/software

解压在/usr/local/fast

unzip fastdfs-nginx-module-master.zip -d /usr/local/fast/

cd ../fast 进入到fast目录下 ls

修改名字  mv fastdfs-nginx-module-master/ fastdfs-nginx-module/

cd fastdfs-nginx-module/src下

vim config

ngx_module_incs="/usr/local/include"  改为 ngx_module_incs="/usr/include"

CORE_INCS="$CORE_INCS /usr/local/include" 改为  CORE_INCS="$CORE_INCS /usr/include"

保存退出

cd /usr/local/nginx-1.19.1/

添加Nginx配置

./configure --add-module=/usr/local/fast/fastdfs-nginx-module/src/

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

cp /usr/local/fast/fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs/

编辑

connect_timeout=15

tracker_server=192.168.1.6:22122

url_have_group_name = true

store_path0=/fastdfs/storage

然后cd  /usr/local/fast/FastDFS/conf 下

cp http.conf mime.types /etc/fdfs/

然后创建软连接 

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

然后修改

cd /usr/local/nginx/conf/

vim nginx.conf


然后正常启动Nginx就可以了

/usr/local/nginx/sbin/nginx

http://192.168.1.9:8888/group1/M00/00/00/wKgBCV8ciMaAQqNsAA3zd6L1JBs724.zip

group1/M00/00/00/wKgBCV8ciMaAQqNsAA3zd6L1JBs724.zip上传时候返回的路径就可以下载该文件了


参考

https://www.cnblogs.com/binghe001/p/13222361.html

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。