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 ....
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
原文链接:https://www.f2er.com/centos/380010.html