5.1 下载安装
- wget https://github.com/happyfish100/fastdfs-nginx-module/archive/5e5f3566bbfa57418b5506aaefbe107a42c9fcb1.zip
-
- unzip5e5f3566bbfa57418b5506aaefbe107a42c9fcb1.zip
-
- mv fastdfs-nginx-module-5e5f3566bbfa57418b5506aaefbe107a42c9fcb1/fastdfs-nginx-module
5.2 配置Nginx
- ngix-s stop
-
- cd nginx-1.12.1
-
- #添加模块
-
- ./configure--add-module=../fastdfs-nginx-module/src
-
- (如果你是yum安装的nginx,我暂时还没找到解决办法,目前的方法是nginx-V查看nginx版本,然后下载一个同版本的nginx,
-
- 然后将/etc/nginx下数据整体备份,make&&make install完成后再做恢复)
-
- #重新编译和安装
-
- make
-
- make install
-
- #拷贝配置文件
-
- [root@s168 src]#pwd
-
- /home/fantj/download/fastdfs-nginx-module/src
-
- [root@s168 src]#cp mod_fastdfs.conf/etc/fdfs/
配置 /etc/fdfs/mod_fastdfs.conf文件
- #配置 /etc/fdfs/mod_fastdfs.conf文件
-
- base_path=/fastdfs/tmp #日志目录
-
- store_path0=/fastdfs/storage
-
- tracker_server=192.168.27.168:22122
-
- # the group name of the local storage server
-
- group_name=fantj #和storage的groupname一一对应
-
- url_have_group_name=true #开启url中附带group_name
配置nginx
- # 配置nginx
-
- [root@s168 fdfs]#cd/usr/local/nginx/conf/
-
- [root@s168 conf]#vim nginx.conf
-
- #添加如下配置
-
- server{
-
- listen88;
-
- server_name192.168.27.168;
-
- location/fantj/M00{
-
- ngx_fastdfs_module;
-
- }
-
- }
-
-
- # 进入/usr/local/nginx/sbin目录执行配置检测
-
- [root@s168 sbin]#./nginx -t
-
- ngx_http_fastdfs_set pid=6431
-
- nginx:the configuration file/usr/local/nginx/conf/nginx.conf syntaxisok
-
- nginx:configuration file/usr/local/nginx/conf/nginx.conf testissuccessful
-
- # 启动nginx
-
- [root@s168 sbin]#./nginx
-
- ngx_http_fastdfs_set pid=6436
(编辑:晋中站长网)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|