CentOS 6.5 FastDFS+nginx安裝配置

1.安裝FastDFS及nginx

http://blog.csdn.net/Zhou_Andy/article/details/51481373

2.配置FastDFS及nginx自啓動

chkconifg --add /etc/init.d/fdfs_trackerd

chkconifg --add /etc/init.d/fdfs_storaged

chkconfig --add /etc/init.d/nginx

vi /etc/init.d/nginx

#!/bin/bash
# nginx Startup script for the Nginx HTTP Server
# it is v.0.0.2 version.
# chkconfig: 2345 99 01

....

3.修改nginx配置文件

listen       8888;

location /group1/M00 {
            root /usr/fastdfs/storage0/data;
            add_header Access-Control-Allow-Origin *;    ### 用於canvas跨域訪問圖片
            ngx_fastdfs_module;

}


4.在防火牆上開啓22122,8888端口

iptables -A INPUT -p tcp --dport 22122 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 22122 -j ACCEPT
iptables -A INPUT -p tcp --dport 8888 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 8888 -j ACCEPT
service iptables save

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章