学习fastdfs时的坑

最近项目使用到了fastdfs,试着在虚拟机上安装一下

查看的资料:https://blog.csdn.net/kong050kong/article/details/90182755

通过该资料进行安装时遇到一个坑:

1.在nginx 进行编译时报错:

问题:/home/wang/桌面/FastDFS/fastdfs-nginx-module/src/common.c:21:10: fatal error: fdfs_define.h: 没有那个文件或目录
#include "fdfs_define.h"
^~~~~~~~~~~~~~~
compilation terminated.
objs/Makefile:1098: recipe for target 'objs/addon/src/ngx_http_fastdfs_module.o' failed

 方案:敲入命令创建软连接:

ln -sv /usr/include/fastcommon /usr/local/include/fastcommon 
ln -sv /usr/include/fastdfs /usr/local/include/fastdfs 
ln -sv /usr/lib64/libfastcommon.so /usr/local/lib/libfastcommon.so

再次make 就好了

2.图片上传成功后会返回一个路径:group1/M00/00/00/wKgBgF3gwYqAaK2nAAEB8T-Fovs551.jpg

我在路径:/home/python/fastdfs/storage/data 下找到了该照片

通过:wget http://192.168.1.128/group1/M00/00/00/wKgBgF3gwYqAaK2nAAEB8T-Fovs551.jpg  下载照片时报错:没有找到该文件

方案:cd /usr/local/nginx/conf/ vi nginx.conf  我们需要在配置文件上设置识别  M00

修改:location ~/M00 {
        root /home/python/fastdfs/storage/data;
        ngx_fastdfs_module;
         }

 

 

 

posted @ 2019-11-21 09:49  宗贵涛  阅读(583)  评论(0编辑  收藏  举报