- Download address http://nginx.org/en/download….
- Select download stable version
- Upload to server
- Unzip to the installation directory and delete the package
- Try to compile nginx, first into the ngixn directory
cd /opt/nginx1.61
./configure --prefix=/opt/nginx
- 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
- compile
make
- install
make install