CentOS 6.7 configure yum to install Nginx
Configure yum to install Nginx in CentOS 6.7.
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/6/$basearch/gpgcheck=0enabled=1
Save,/etc/yum.repos.d/nginx.repo
File.
Run the following command to automatically install Nginx:
yum install nginx -y
After the installation is complete, you can start Nginx directly:
service 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 ACCEPTservice iptables saveservice iptables restart
Nginx command and configuration file location:
Service nginx start # start Nginx service nginx stop # stop Nginx service nginx. conf # Nginx configuration file location
So far, Nginx has been fully configured and installed.
For more Nginx tutorials, see the following:
Deployment of Nginx + MySQL + PHP in CentOS 6.2
Build a WEB server using Nginx
Build a Web server based on Linux6.3 + Nginx1.2 + PHP5 + MySQL5.5
Performance Tuning for Nginx in CentOS 6.3
Configure Nginx to load the ngx_pagespeed module in CentOS 6.3
Install and configure Nginx + Pcre + php-fpm in CentOS 6.4
Nginx installation and configuration instructions
Nginx log filtering using ngx_log_if does not record specific logs
Nginx details: click here
Nginx: click here
This article permanently updates the link address: