fastdfs使用nginx出现的问题

        3.解决报错

        make的时候会报一下错误,

        root/fastdfs-nginx-module/src//common.c:21:25: fatal error: fdfs_define.h: No such file or directory

 #include "fdfs_define.h"

                        ^

compilation terminated.

make[1]: *** [objs/addon/src/ngx_http_fastdfs_module.o] Error 1

解决办法:

  vim /root/fastdfs-nginx-module/src/config

 

 CORE_INCS="$CORE_INCS /usr/local/include/fastdfs /usr/local/include/fastcommon/"

 CORE_LIBS="$CORE_LIBS -L/usr/lib -lfastcommon -lfdfsclient"

 重新编译,安装即可

-------------------------------


[root@fastdfs-storage ~] # vim /application/nginx/conf/nginx.conf
     user  root;    
     worker_processes  1;
     events {
        worker_connections  1024;
     }
     http {
         include       mime.types;
         default_type  application /octet-stream ;
         sendfile        on;
         keepalive_timeout  65;
         server {
             listen       8888;
             server_name  localhost;
             location ~ /group [0-9]/ {
                 ngx_fastdfs_module;
             }
             error_page   500 502 503 504   /50x .html;
             location =  /50x .html {
             root   html;
             }
         }
     }

说明: 

a、"user root"是解决下载操作时报404的问题

b、8888端口号与/etc/fdfs/storage.conf中的http.server_port=8888相对应

c、storage对应有多个group的情况下,访问路径带group名称,例如:/group1/M00/00/00/**,对应nginx配置:

    location ~/group[0-9]/ {
           ngx_fastdfs_module;
     }



参考文献

http://www.linuxidc.com/Linux/2015-11/125095.htm

http://blog.itpub.net/29254281/viewspace-1288761/

http://oldcat1981.blog.51cto.com/10670523/1766810

你可能感兴趣的:(JavaWeb)