CentOS 6.5 FastDFS+nginx安装配置

前端之家收集整理的这篇文章主要介绍了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

猜你在找的CentOS相关文章