Home > Article > Operation and Maintenance > How to install Nginx under centos6.5
1. Configure yum source:
Create file:/etc/yum.repos.d/nginx.repo
touch /etc/yum.repos.d/nginx.repo
Edit the file,
vi /etc/yum.repos.d/nginx.repo
Write the following content:
[nginx] name=nginx repo baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ gpgcheck=0 enabled=1
Save, now the yum source configuration is completed.
You can check whether the yum source is configured correctly by using the following command
yum list |grep nginx
The output is as follows:
indicates that the yum source is configured correctly.
2. Install nginx through yum
Execute the following instructions to install yum:
yum -y install nginx
Execute the following instructions to check whether nginx is installed successfully:
rpm -q nginx
3. Start nginx
service nginx start
As shown in the figure, the startup is successful:
4. View the nginx installation directory , and the directory where the configuration file (nginx.conf) is located
ps -aef|grep nginx
Output the following content:
The above is the detailed content of How to install Nginx under centos6.5. For more information, please follow other related articles on the PHP Chinese website!