网络云盘项目nginx添加fastdfs模块

3次阅读

共计 1355 个字符,预计需要花费 4 分钟才能阅读完成。

  • 解压 fastdfs-nginx-module-1.20
  • 进入 Nginx 安装目录
  • 重新配置安装包,添加 fastdfs 源码目录
sudo ./configure --add-module=/root/libinstall/fastdfs-nginx-module-1.20/src

make

  • 报错

  • 解决方案:
root@ubuntu:/home/wangsx/libinstall/download/nginx-1.10.3# find /usr/include/ -name common_define.h
/usr/include/fastcommon/common_define.h

修改 obj/makefile, 添加找到的路径

make&&make install
  • 启动 nginx
#/usr/local/nginx/sbin/nginx
root@ubuntu:/usr/local/nginx# ps -aux|grep nginx
root      13860  0.0  0.0  36836   600 ?        Ss   07:48   0:00 nginx: master process ./nginx
root      14072  0.0  0.0  21292   928 pts/2    S+   07:54   0:00 grep --color=auto nginx

发现 worker 进程未启动
查看日志

vi ./logs/error.log


缺少配置文件,找到拷贝到目录下

root@ubuntu:~/libinstall/fastdfs-nginx-module-1.20/src# cp mod_fastdfs.conf /etc/fdfs/
  • 修改 mod_fastdfs.conf 配置文件


保存退出:
重启 nginx

root@ubuntu:/etc/fdfs# ps -aux |grep nginx
root      14326  0.0  0.0  36836   604 ?        Ss   08:19   0:00 nginx: master process nginx
root      14331  0.0  0.0  21292  1084 pts/2    S+   08:19   0:00 grep --color=auto nginx

依旧没有 worker 进程
继续看 log


解决方案:

root@ubuntu:~/libinstall/fastdfs-5.11/conf# cp http.conf /etc/fdfs/
root@ubuntu:/home/wangsx/libinstall/download/nginx-1.10.3/conf# cp mime.types /etc/fdfs/
root@ubuntu:~/libinstall/fastdfs-5.11/conf# nginx -s stop
root@ubuntu:~/libinstall/fastdfs-5.11/conf# nginx
root@ubuntu:~/libinstall/fastdfs-5.11/conf# ps aux |grep nginx
root      14740  0.0  0.0  36836   600 ?        Ss   08:35   0:00 nginx: master process nginx
nobody    14741  0.1  0.1  37276  3560 ?        S    08:35   0:00 nginx: worker process
root      14743  0.0  0.0  21292   928 pts/18   S+   08:35   0:00 grep --color=auto nginx

OK 了~

正文完
 0