CentOS 7编译安装Nginx

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

# tar -zxvf nginx-1.16.0.tar.gz

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

遇到报错

./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.

原因是缺少pcre库,运行下面命令安装

# yum  install pcre-devel

安装成功后,重新运行confing命令,成功后,运行

# make

进行编译,完成后,运行

# make install

进行安装,至此,Nginx就编译安装成功了。

猜你喜欢

转载自www.cnblogs.com/itero/p/11125464.html