CentOS 7 compile and install Nginx

# wget http://nginx.org/download/nginx-1.16.0.tar.gz

# tar -zxvf nginx-1.16.0.tar.gz

# ./configure --prefix=/usr/nginx

I encountered an error

./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.

The reason is the lack of pcre library, run the following command to install

# yum  install pcre-devel

After successful installation, rerun confing command is successful, run

# make

Compile, after completion, running

# make install

Install, so far, Nginx will compile the installation was successful.

Guess you like

Origin www.cnblogs.com/itero/p/11125464.html