码迷,mamicode.com
首页 > 其他好文 > 详细

FastDFS-5.05 stroage服务器安装nginx

时间:2016-08-23 16:26:00      阅读:165      评论:0      收藏:0      [点我收藏+]

标签:

1.接上一篇,在storage服务器中安装,安装nginx

yum install pcre pcre-devel openssl openssl-devel -y
useradd -s /sbin/nologin -M nginx
cd /usr/local/src
wget http://nginx.org/download/nginx-1.8.1.tar.gz
tar -zxvf nginx-1.8.1.tar.gz
./configure --prefix=/usr/local/nginx-1.8.1 --user=nginx --group=nginx --with-http_ssl_module --with-http_stub_status_module
make
make install
ln -s /usr/local/nginx-1.8.1/ /usr/local/nginx

 2.在fastdfs中安装nginx支持,到make就可以

cd /usr/local/src/
git clone https://github.com/happyfish100/fastdfs-nginx-module.git
cd fastdfs-nginx-module/
./configure --prefix=/usr/local/nginx-1.8.1 --user=nginx --group=nginx --with-http_ssl_module --with-http_stub_status_module --add-module=/usr/local/src/fastdfs-nginx-module/src
make

# 把重新编译的nginx替换原来的nginx
cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak
cp cp /usr/local/src/nginx-1.8.1/objs/nginx/usr/local/nginx/sbin/

 3.配置fastdfs里nginx配置文件

cd /usr/local/src/fastdfs-nginx-module/src
cp mod_fastdfs.conf /etc/fdfs
cd /usr/local/src/fastdfs-5.05/conf
cp anti-steal.jpg http.conf mime.types /etc/fdfs

 4.配置mod_fastdfs.conf,配置文件加入

[root@img02 ~]# vim /etc/fdfs/mod_fastdfs.conf
[group1]
group_name=G1
storage_server_port=23000
store_path_count=2
store_path0=/data2/

技术分享

 5.nginx配置文件加入

[root@img02 ~]#vim /usr/local/nginx/conf/nginx.conf

        location /group1/M00 {
                root /data2/;
                ngx_fastdfs_module;

touch /var/log/mod_fastdfs.log
chown nginx.nginx /var/log/mod_fastdfs.log

 

FastDFS-5.05 stroage服务器安装nginx

标签:

原文地址:http://www.cnblogs.com/sunmmi/p/5799692.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!