Analysis of simple installation examples of Nginx under centos6.5

WBOY
Release: 2023-06-01 21:07:22
forward
1246 people have browsed it

1. Configure yum source:

Create file:/etc/yum.repos.d/nginx.repo

touch /etc/yum.repos.d/nginx.repo
Copy after login

Edit the file,

vi /etc/yum.repos.d/nginx.repo
Copy after login

Write the following content:

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1
Copy after login

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
Copy after login

The output is as follows:

Analysis of simple installation examples of Nginx under centos6.5

indicates that the yum source is configured correctly.

2. Install nginx through yum

Execute the following instructions to install yum:

yum -y install nginx
Copy after login

Execute the following instructions to check whether nginx is installed successfully:

rpm -q nginx
Copy after login

3. Start nginx

service nginx start
Copy after login

As shown in the figure, the startup is successful:

Analysis of simple installation examples of Nginx under centos6.5

4. View the nginx installation directory , and the directory where the configuration file (nginx.conf) is located

ps -aef|grep nginx
Copy after login

Output the following content:

Analysis of simple installation examples of Nginx under centos6.5

The above is the detailed content of Analysis of simple installation examples of Nginx under centos6.5. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template