./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-devel
1
yum -y install pcre-devel
安装pcre-devel完成后再次执行命令
1
./configure --prefix=/usr/local/nginx
执行完后还有可能会出现这样的问题:
1 2 3 4 5 6 7
checking for PCRE JIT support ... not found checking for system md library ... not found checking for system md5 library ... not found checking for OpenSSL md5 crypto library ... not found checking for sha1 in system md library ... not found checking for OpenSSL sha1 crypto library ... not found checking for zlib library ... found
若出现上述问题则安装openssl
1
yum -y install openssl openssl-devel
安装openssl完成后再次执行命令
1
./configure --prefix=/usr/local/nginx
出现下图信息则说明配置成功
4.安装
1 2
make make install
出现类似这样的就表示安装成功了
1 2 3 4 5 6
cp conf/nginx.conf '/usr/local/nginx/conf/nginx.conf.default' test -d '/usr/local/nginx/logs' || mkdir -p '/usr/local/nginx/logs' test -d '/usr/local/nginx/logs' || mkdir -p '/usr/local/nginx/logs' test -d '/usr/local/nginx/html' || cp -R html '/usr/local/nginx' test -d '/usr/local/nginx/logs' || mkdir -p '/usr/local/nginx/logs' make[1]: Leaving directory '/root/setup/nginx/nginx-1.14.1'