網絡雲盤項目-nginx添加fastdfs-模塊

  • 解壓 fastdfs-nginx-module-1.20
  • 進入Nginx安裝目錄
  • 從新配置安裝包,添加fastdfs源碼目錄
sudo ./configure --add-module=/root/libinstall/fastdfs-nginx-module-1.20/src

makenginx

  • 報錯

clipboard.png

  • 解決方案:
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,添加找到的路徑ubuntu

clipboard.png

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 進程未啓動
查看日誌c#

vi ./logs/error.log

clipboard.png
缺乏配置文件 ,找到拷貝到目錄下spa

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

clipboard.png

clipboard.png

clipboard.png

clipboard.png

clipboard.png
保存退出:
重啓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進程
繼續看logcode

clipboard.png
解決方案:進程

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了~ip

  • 添加nginx 域名地址解析

修改、/usr/local/nginx/conf/nginx.conf配置文件
添加以下:源碼

clipboard.png

nginx -s reload

成功效果以下:域名

clipboard.png至此,nginx+fastdfs配置完成。

相關文章
相關標籤/搜索