轉:http://my.oschina.net/VincentJiang/blog/224993
CENTOS 6.5 設定YUM安裝NGINX
<spanmicrosoft yahei font-size:14px>nginx.repo</spanmicrosoft>
<spanmicrosoft yahei font-size:14px></spanmicrosoft>
cd /etc/yum.repos.d/
vim nginx.repo
[nginx] name=nginx repo baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ gpgcheck=0 enabled=1
下面直接執行如下指令即可自動安裝好Nginx:
yum install nginx -y
安裝完成,下面直接就可以啟動Nginx了:
<spanmicrosoft yahei font-size:14px></spanmicrosoft>
如果還無法訪問,則需配置Linux防火牆。 /etc/init.d/nginx start
Nginx的指令以及設定檔位置:
iptables -I INPUT 5 -i eth0 -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT service iptables save service iptables restart