搜诶符合你 发表于 2018-11-10 10:58:29

FastDFS+Nginx问题及修复

  FastDFS+nginx问题及修复:
  1、 30000#0: *1 open() "/usr/local/nginx/html/group1/M00/00 /00/wKgAA1cLh12AI0kfAAAADzbdjmQ50_big.html
  "failed (2: No such file or directory), client: 192.168.0.181, server:localhost, request:
  "GET/group1/M00/00/00/wKgAA1cLh12AI0kfAAAADzbdjmQ50_big.html HTTP/1.1", host:"192.168.0.3"
  原因:具体原因不明,可能是在做alias匹配的时候路径出现的问题
  修复:修改nginx.conf中的location配置为:
  location/group1/M00/ {
  alias /home/FastDFS/data;
  ngx_fastdfs_module;
  }
  2、ERROR - file: ../common/fdfs_global.c, line:52, the format of filename
  "group1/M00/00/00/wKgAA1cLh12AI0kfAAAADzbdjmQ50_big.html"is invalid
  原因:nginx的fdfs的MOD里面默认没有开启url_have_group_name
  修复:开启mod_fastdfs.conf文件中的url_have_group_name选项,后重启nginx
  
  3、/usr/src/fastdfs-nginx-module/src/common.c:21:25:致命错误:fdfs_define.h:没有那个文件或目录
  #include "fdfs_define.h"
  编译中断。
  原因:编译安装nginx的fastdfs插件的头文件没有找到,由于编译nginx时候系统会到/usr/local /include,
  而编译安装fastdfs-nginx-module时则默认保存在了/usr/include目录。
  修复:ln -s /usr/include/fast* /usr/local/include/
  4、Nginx启动后error.log日志报错
  ERROR - file:../storage/trunk_mgr/trunk_shared.c, line: 177, "No such file ordirectory" can't be accessed, error info: /data/fastdfs
  ERROR - file:../storage/trunk_mgr/trunk_shared.c, line: 177, "No such file ordirectory" can't be accessed, error info: /data/fastdfs
  ERROR - file:../storage/trunk_mgr/trunk_shared.c, line: 177, "No such file ordirectory" can't be accessed, error info: /data/fastdfs
  ERROR - file:../storage/trunk_mgr/trunk_shared.c, line: 177, "No such file ordirectory" can't be accessed, error info: /data/fastdfs
  原因:nginx的fdfs插件没有在/etc/fdfs目录中找到http.conf和mime.types。
  修复:复制或者创建对应文件的软连接
  cp/usr/local/FastDFS/conf/http.conf /etc/fdfs/
  cp/usr/local/FastDFS/conf/mime.types /etc/fdfs/
  5、页面访问动态缩略图返回415
  原因:首先需要排除文件类型的问题,image_filter只支持jpg、git和png三种格式的图片文件,调用其他格式的
  图片文件 会返回415。
  其次要确认设置的image_filter缓存是否小于上传的图片大小,如果小于同样会报415错误。如果排除以上两种可能性,
  那么出现的问题应该是没有在Nginx页面的DocumentRoot目录创建FastDFS数据存储的软连接。
  修复:执行下列命令创建软连接:
  # mkdir -pv/usr/local/nginx/html/group1
  # ln -s /data/fastdfs_store/data/usr/local/nginx/html/group1/M00

页: [1]
查看完整版本: FastDFS+Nginx问题及修复