How to quickly install Nginx server on CentOS

PHPz
Release: 2023-05-14 12:04:12
forward
895 people have browsed it

1. Download nginx

Download the latest version of nginx from the official website of nginx (http://nginx.org/en/download.html), here I download it The one is nginx-1.9.12.

How to quickly install Nginx server on CentOS

After the download is completed, you will get a compressed package as shown below

How to quickly install Nginx server on CentOS

Upload nginx tar package to the linux server, as shown below:

How to quickly install Nginx server on CentOS

2. Install nginx

2.1. Installation prerequisites

Before installing nginx, you need to ensure that the system has g, gcc, openssl-devel, pcre-devel and zlib-devel software installed.

 1. Install the necessary software: yum -y install zlib zlib-devel openssl openssl--devel pcre pcre-devel

The installation process is as shown below:

How to quickly install Nginx server on CentOS

How to quickly install Nginx server on CentOS

## 2.2. Install nginx dependency packages: yum install geoip gd libxpm libxslt


Installation process As shown in the figure below:


How to quickly install Nginx server on CentOS

How to quickly install Nginx server on CentOS

##2.2. Unzip and install nginx


Enter the directory where the nginx installation package is located and decompress the nginx compressed package, as shown in the following figure:

How to quickly install Nginx server on CentOS After decompression is completed, there is an additional nginx-1.9.12 directory, enter nginx Check the contents in the -1.9.12 directory, as shown below:


How to quickly install Nginx server on CentOS The installation of source code generally consists of three steps: configure (configure), compile (make ), install (make install)


 1. Execute ./configure


How to quickly install Nginx server on CentOS

# . The /configure command was executed successfullyHow to quickly install Nginx server on CentOS

 2. Execute the make operation, as shown in the following figure:


How to quickly install Nginx server on CentOS

## make The operation is completed.

How to quickly install Nginx server on CentOS

 3. Execute the make install command to install.


2.3. Verify whether the nginx installation is successful

1. Check the nginx installation path (whereis nginx)


## 2. Start nginx

How to quickly install Nginx server on CentOS


Enter http://centos server IP in the browser to access nginx. For example, my server IP address is: 115.159.95.35. Enter http://115.159.95.35/ to access the installed nginx. The access results are as shown below. Display:

How to quickly install Nginx server on CentOS


If you can see the nginx welcome page normally, it means that nginx has been installed successfully.

The above is the detailed content of How to quickly install Nginx server on CentOS. 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!