栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

FastDFS 和nginx整合

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

FastDFS 和nginx整合

#tracker_server=192.168.101.4:22122(多个tracker配置多行)

url_have_group_name=true            #url中包含group名称

store_path0=/home/fastdfs/fdfs_storage   #指定文件存储路径

  • 将libfdfsclient.so拷贝至/usr/lib下

cp /usr/lib64/libfdfsclient.so /usr/lib/

  • 创建nginx/client目录

mkdir -p /var/temp/nginx/client

  • 添加FastDFS-nginx-module模块

进入nginx安装目录执行:

./configure

–prefix=/usr/local/nginx

–pid-path=/var/run/nginx/nginx.pid

–lock-path=/var/lock/nginx.lock

–error-log-path=/var/log/nginx/error.log

–http-log-path=/var/log/nginx/access.log

–with-http_gzip_static_module

–http-client-body-temp-path=/var/temp/nginx/client

–http-proxy-temp-path=/var/temp/nginx/proxy

–http-fastcgi-temp-path=/var/temp/nginx/fastcgi

–http-uwsgi-temp-path=/var/temp/nginx/uwsgi

–http-scgi-temp-path=/var/temp/ 《一线大厂Java面试题解析+后端开发学习笔记+最新架构讲解视频+实战项目源码讲义》无偿开源 威信搜索公众号【编程进阶路】 nginx/scgi

–add-module=/usr/local/fastdfs-nginx-module/src

如果报错请检查路径是否正确

  • 安装:

make

make install

  • 拷贝:

cp /usr/local/FastDFS/conf/http.conf mime.types /etc/fdfs/

  • 创建软连接:

在/fastdfs/storage文件存储目录下创建软连接,将其链接到实际存放数据

的目录。

命令:

ln -s  /home/fastdfs/fdfs_storage/data   /home/fastdfs/fdfs_storage/data/M00

修改nginx.conf:

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

添加以下内容:

server {

listen 8888;

server_name localhost;

location /group1/M00/{

#root /home/fastdfs/fdfs_storage/data;

ngx_fastdfs_module;

}

}

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/863369.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号