System Centos 64 bit
The first step is to download the tar package of Nginx and install the dependent tool tar package.
Nginx: http://nginx.org/en/download.html
Nginx needs to depend on the following 3 packages
gzip module needs zlib library (download: http://www.zlib.net/ )
rewrite module needs pcre library (download: http://www.pcre.org/ )
ssl function needs openssl library (Download: http://www.openssl.org/ )
Unzip separately.
Specific command:
wget http://nginx.org/download/nginx-1.13.2.tar.gz wget http://www.zlib.net/zlib-1.2.11.tar.gz wget https://ftp.pcre.org/pub/pcre/pcre-8.40.tar.gz wget https://www.openssl.org/source/openssl-fips-2.0.16.tar.gz tar zxvf openssl-fips-2.0.16.tar.gz tar zxvf nginx-1.13.2.tar.gz tar zxvf zlib-1.2.11.tar.gz tar zxvf pcre-8.40.tar.gz
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
The second step is to compile and install
Installation order: install the three dependency packages first and then install nginx
cd 到各个解压目录下运行
./configure && make && make install
- 1
- 2
Install the c++ compilation environment
yum install gcc-c++
- 1
The third step is to run nginx
The installed nginx path is:
/usr/local/nginx
- 1
- 2
The default configuration file path is:
/usr/local/nginx/conf/nginx.conf
- 1
Run nginx:
/usr/local/nginx/sbin/nginx
- 1
Access the server ip through a browser, and the following sign appears, indicating that the startup is successful:
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required. For online documentation and support please refer to nginx.org. Commercial support is available at nginx.com. Thank you for using nginx.
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
If you have any questions, please point it out in the message, thank you very much.