Nginx installation

Time:2021-1-13
  1. Download address http://nginx.org/en/download….
  2. Select download stable version
  3. Upload to server
  4. Unzip to the installation directory and delete the package
  5. Try to compile nginx, first into the ngixn directory
cd /opt/nginx1.61
./configure --prefix=/opt/nginx
  1. Compilation will definitely fail. You need to install related dependencies. Install dependencies (CentOS 7.6)

==./configure: error: the HTTP rewrite module requires the PCRE library.==

yum install -y pcre pcre-devel 

==./configure: error: the HTTP gzip module requires the zlib library.==

yum install -y zlib zlib-devel 

It is recommended to install the library dependency of SSL again

yum install -y openssl openssl-devel

In general, it is

yum install -y pcre  pcre-devel zlib zlib-devel openssl openssl-devel

A makefile will be generated in the current folder

  1. compile
make
  1. install
make install