: This article describes how to install Nginx on CentOS. if you are interested in the PHP Tutorial, refer to it. Turn: http://my.oschina.net/VincentJiang/blog/224993
CENTOS 6.5 configure YUM to install NGINX
Step 1:/etc/yum.repos.d/Create a source configuration file under the Directorynginx.repo:
cd /etc/yum.repos.d/ vim nginx.repo
Enter the following content:
[nginx]name=nginx repobaseurl=http://nginx.org/packages/centos/$releasever/$basearch/gpgcheck=0enabled=1
(Note: The nginx. repo file is used to download the corresponding system version when installing nginx using yum. I used CentOS, so I wrote/centos/in the baseurl /)
Save,
/etc/yum.repos.d/nginx.repoFile.
Run the following command to automatically install Nginx:
yum install nginx -y
After the installation is complete, you can start Nginx directly:
/etc/init.d/nginx start
Now that Nginx has been started, you can directly access the server to see the Nginx welcome page.
If the access is unavailable, configure the Linux firewall.
iptables -I INPUT 5 -i eth0 -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT service iptables save service iptables restart
Nginx command and configuration file location:
/Etc/init. d/nginx start # start Nginx service/etc/init. d/nginx stop # stop Nginx service/etc/nginx. conf # Nginx configuration file location
So far, Nginx has been fully configured and installed.
The above introduces how to install Nginx in CentOS, including some content. I hope my friends who are interested in the PHP Tutorial can help me.