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.
After the download is completed, you will get a compressed package as shown below
Upload nginx tar package to the linux server, as shown below:
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:
Enter the directory where the nginx installation package is located and decompress the nginx compressed package, as shown in the following figure:
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:
The installation of source code generally consists of three steps: configure (configure), compile (make ), install (make install)
1. Execute ./configure
# . The /configure command was executed successfully
2. Execute the make operation, as shown in the following figure:2.3. Verify whether the nginx installation is successful
1. Check the nginx installation path (whereis nginx)
## 2. Start nginx
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:
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!