The first step is to /etc/yum.repos.d/
create a source configuration file under the directory nginx.repo
:
cd/etc/Yumrepos.d/vim Nginx.repo
Fill in the following content:
[Nginx]name=nginx repobaseurl=http://nginx.org/packages/centos/6/$basearch/ gpgcheck=0Enabled=1
Saved, a file is generated /etc/yum.repos.d/nginx.repo
.
The following instructions can be executed directly below to install Nginx automatically:
Yum Install nginx-y
The installation is complete, the following directly can start Nginx:
Service Nginx Start
Now Nginx has been launched, direct access to the server will be able to see the Nginx Welcome page.
If you are still unable to access it, you need to configure your Linux firewall.
5 -M state--state new,established-J acceptservice iptables saveservice iptables Restart
Nginx command and configuration file location:
Service Nginx Start # start Nginx Services service Nginx Stop # Stop Nginx Services Service nginx.conf # nginx configuration file location
At this point, Nginx has been fully configured to complete the installation.
CentOS 6.7 Configuration Yum installation Nginx