: This article describes how to install and deploy Nginx in CentOs. For more information about PHP tutorials, see. System: centOS
First, install gcc, gcc-c ++, make, and other compilation tools.
Yum install XXXX
Nginx installation
Module-dependent Nginx depends on the following three packages
1. the gzip module requires the zlib library (Download: http://www.zlib.net /)
2. the rewrite module requires the pcre library (Download: http://www.pcre.org /)
3. ssl features require the openssl library (Download: http://www.openssl.org /)
Nginx package download: http://mirrors.sohu.com/nginx/
The dependency packages are installed in sequence: openssl, zlib, and pcre, and then Nginx packages are installed.
Graphic tutorial
Step 1: Download and install the required package
Download zlib dependency package
Download the pcre dependency package
Download openssl dependency package
Download Nginx package
Select a stable version
Complete installation packages:
Openssl-fips-2.0.9.tar.gz
Zlib-1.2.8.tar.gz
Pcre-8.32.tar.gz
Nginx-1.9.1.tar.gz
Step 2:
Install openssl-fips-2.0.9.tar.gz, zlib-1.2.8.tar.gz, pcre-8.32.tar.gz, nginx-1.9.1.tar.gz
1.install openssl-fips-2.0.9.tar.gz
[Root @ localhost mrms] # tar-zxvf openssl-fips-2.0.9.tar.gz [Root @ localhost mrms] # cd openssl-fips-2.0.9 [Root @ localhost openssl-fips-2.0.9] #./config [Root @ localhost openssl-fips-2.0.9] # make [Root @ localhost openssl-fips-2.0.9] # make install |
2.install zlib-1.2.8tar.gz
[Root @ localhost mrms] # tar-zxvf zlib-1.2.8.tar.gz [Root @ localhost mrms] # cd zlib-1.2.8 [Root @ localhost zlib-1.2.8] #./configure [Root @ localhost zlib-1.2.8] # make [Root @ localhost zlib-1.2.8] # make install |
3.install pcre-8.32.tar.gz
[Root @ localhost mrms] # tar-zxvf pcre-8.32.tar.gz [Root @ localhost mrms] # cd pcre-8.32 [Root @ localhost pcre-8.32] #./configure [Root @ localhost pcre-8.32] # make [Root @ localhost pcre-8.32] # make install |
4. install nginx-1.9.1.tar.gz
[Root @ localhost mrms] # tar-zxvf nginx-1.9.1.tar.gz [Root @ localhost mrms] # cd nginx-1.9.1 [Root @ localhost nginx-1.9.1] #./configure -- sbin-path =/usr/local/nginx \ -- Conf-path =/usr/local/nginx. conf \ -- Pid-path =/usr/local/nginx. pid \ -- With-pcre =/usr/local/src/pcre-8.32 \ -- With-zlib =/usr/local/src/zlib-1.2.8 \ -- With-openssl =/usr/local/src/openssl-fips-2.0.9 [Root @ localhost nginx-1.9.1] # make [Root @ localhost nginx-1.9.1] # make install |
So far Nginx installation is complete!
Check whether the installation is successful
[Root @ localhost nginx-1.9.1] # cd/usr/local/nginx/
[Root @ localhost sbin] #./nginx-t
, Indicating that Nginx is successfully installed.
Start nginx
[Root @ localhost sbin] #./nginx
View Port
[Root @ localhost sbin] # netstat-ntlp
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.
The above describes how to install and deploy Nginx in CentOs, including some content. if you are interested in the PHP Tutorial.