What Nginx does:

  • Load balancing server
  • Mail proxy server
  • Realize the front end dynamic and static separation

Nginx features:

  • High stability
  • A high performance
  • Less resource usage
  • feature-rich
  • Modular construction
  • Hot deployment

Installation environment

  • System: CentOS 6.8 64-bit

Installation-dependent dependencies

If you have never configured Nginx, feel the following input command is very troublesome, can be directly repeated.

  • All commands:
 yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-develCopy the code

Below are the detailed instructions

1. Install GCC

  • Install command
 sudo yum install gccCopy the code
  • Note: You can first enter GCC -v to check the version information and check whether the system comes with it. If the version is too early, you can choose to update it or uninstall it and install it again. 2. Install pcRE
  • Installation command:
 sudo yum install pcre-develCopy the code

3. Install zlib

  • Installation command:
 sudo yum install zlib zlib-develCopy the code

4. Install OpenSSL

  • Installation command:
 sudo yum install openssl openssl-develCopy the code
  • Note: Only install OpenSSL if SSL is required. 5.
  • All commands:
 yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-develCopy the code

Download the Nginx source package

It’s better to have a stable version hanging here, unzip it and install it (http://www.nginx.org/)

(1) the wget http://nginx.org/download/nginx-1.14.2.tar.gz or visit http://nginx.org/download/nginx-1.14.2.tar.gz to download.

(2) the tar – ZXVF nginx – 1.14.2. Tar. Gz

Note that you can also specify the installation directory by adding the parameter –prefix=/user/local/nginx

The tar - ZXVF nginx - 1.14.2. Tar. Gz -- prefix = / user/local/nginxCopy the code
  • You can also query the installation path using whereis nginx without specifying the default path
  • The default installation path is /user/local/nginx

Install Nginx

(1) Go to the decompressed nginx-1.14.2 directory and run./configure

(2) Continue to execute make to compile the link,

(3) Run the make install command to perform the installation.

Complete the above instructions and you have installed Nginx.

If unknown, concentrate on sword training!

Like friends can leave your praise!