1.准备
nginx-1.8.0.tar.gz
fastdfs-nginx-module_v1.15.tar.gz
2.安装过程
--上传安装包到/usr/local/src下
--解压
#tar -zvxf nginx-1.8.0.tar.gz
#tar -zvxf fastdfs-nginx-module_v1.15.tar.gz
--建立makefile
#cd nginx-1.8.0
#./configure --prefix=/usr/local/nginx --add-module=/usr/local/src/fastdfs-nginx-module/src
./configure: error: the HTTP rewrite module requires the PCRE library. You can either disable the module by using --without-http_rewrite_module option, or install the PCRE library into the system, or build the PCRE library statically from the source with nginx by using --with-pcre=<path> option.
解决办法:安装pcre-devel
#yum -y install pcre-devel
--重新建立makefile
#./configure --prefix=/usr/local/nginx --add-module=/usr/local/src/fastdfs-nginx-module/src
#./configure --prefix=/usr/local/nginx --add-module=/usr/local/src/fastdfs-nginx-module/src ./configure: error: the HTTP gzip module requires the zlib library. You can either disable the module by using --without-http_gzip_module option, or install the zlib library into the system, or build the zlib library statically from the source with nginx by using --with-zlib=<path> option.
解决办法:安装zlib-devel
#yum install -y zlib-devel
--重新建立makefile
#./configure --prefix=/usr/local/nginx --add-module=/usr/local/src/fastdfs-nginx-module/src
--编译
#make
--安装
#make install
--编辑nginx.conf
#vi /usr/local/nginx/conf/nginx.conf
worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; server_name localhost; location /group1/M00 { root /var/fastdfs/storage/data; ngx_fastdfs_module; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } }
--建立数据文件的软链接
--/var/fastdfs/storage/data为storage的文件存储路径
#ln -s /var/fastdfs/storage/data /var/fastdfs/storage/data/M00
--配置mod_fastdfs.conf
#cp /usr/local/src/fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs/
#vi /etc/fdfs/mod_fastdfs.conf
base_path=/var/fastdfs/ngx_module tracker_server=192.168.117.100:22122 url_have_group_name=true store_path0=/var/fastdfs/storage
--启动nginx
#/usr/local/nginx/sbin/nginx
--访问图片
http://192.168.172.101/group1/M00/00/00/wKh1ZVWdaIiAJ0NoAAAwB0Ubngg142.jpg
访问失败,查看nginx日志
[2015-07-11 23:52:43] ERROR - file: ../storage/trunk_mgr/trunk_shared.c, line: 177, "No such file or directory" can't be accessed, error info: /var/fastdfs/ngx_module
解决办法
#mkdir -p /var/fastdfs/ngx_module
--重启nginx
#/usr/local/nginx/sbin/nginx -s stop
#/usr/local/nginx/sbin/nginx
--访问图片
http://192.168.172.101/group1/M00/00/00/wKh1ZVWdaIiAJ0NoAAAwB0Ubngg142.jpg
成功
3.参考资料
http://blog.csdn.net/hfsu0419/article/details/7190152
相关推荐
fastdfs 与nginx集成包
fastdfs-nginx-module_master.zip正常
亲测可用,一定要对应版本
最新版linux fastdfs-nginx-module-1.22.tar.gz
(注意注意,里面有个文件libfastcommon... fastdfs-nginx-module_v1.16.tar.gz FastDFS_v5.05.tar.gz libevent-2.0.22-stable.tar.gz libfastcommon_v1.01.tar.gz nginx-1.6.3.tar.gz ngx_cache_purge-2.3.tar.gz
亲测可用,一定要fdfs对应版本
亲测可用,一定要对应相关的fdfs版本
亲测可用,一定要fdfs对应版本
资源内容包含:fastdfs-6.06,fastdfs-nginx-module-1.22,nginx-1.16.1,libfastcommon-1.0.43,兼容完全没问题,属于是拿来即用。
fastdfs分布式文件系统搭建需要的插件,该插件用于编译nginx的安装,nginx添加的一个模块,用于http访问fastdfs资源。
Version 1.20 2017-05-26
nginx 和 fastdfs 整合在一起安装, 先解压编译安装 libfastcommon-master,fastdfs-6.04,fastdfs-master 然后解压 fastdfs-nginx-module-master,nginx-1.9.11. 请在编译安装nginx-1.9.11前配置 ./configure --prefix=...
fastdfs-nginx-module-master分布式文件系统 整套资源,不会有版本冲突,其他文件看我的其他下载( fastdfs-5.11,libfastcommon-master,nginx,fastdfs-client-java)
FastDFS整合Nginx的模块压缩包。网上好像不好找,这里放一个吧,文件压缩了,下载之后解压即可,不要直接用linux解压命令解压。
fastdfs nginx 组件 1.19版本
fastdfs-nginx-module-master 5.0.8 适用 安装时如果fastdfs-nginx-module-master 5.0.8不适用会安装不了
FastDFS+Nginx+libfastcommon+fastdfs-nginx-module安装所需所有中间件
FastDFS 5.10 对应的 nginx 模块 V1.19。如果是FastDFS 5.12则要对应fastdfs-nginx-module-v1.20。内含三个源码,编译即可用