准备安装的模块
./configure --prefix=/usr/local/nginx --with-http_v2_module --with-http_ssl_module --with-http_sub_module --with-http_stub_status_module --with-http_gzip_static_module --with-pcre --with-stream
源下载:http://nginx.org/download/nginx-1.14.0.tar.gz
make报错:缺少pcre,下载pcre源码:https://sourceforge.net/projects/pcre/files/pcre/8.42/
编译安装pcre报错:aclocal-1.15: command not found
aclocal --version 查看版本1.11,需要升级,
升级参考:https://jingyan.baidu.com/article/ab0b563072e697c15afa7d98.html
参考文档中说要“重启一下”,我的处理方式:
1、find / -name aclocal 找到所有aclocal可执行文件;
2、用新生成的aclocal文件替换原来老的文件;
3、aclocal --version 显示版本升级成功;
重新编译安装pcre,过关;
再次对nginx进行编译,无报错,但运行的时候报错:
Starting nginx: /usr/sbin/nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
搜索 find / -name libpcre.so.1,显示文件存在,解决参考:
https://blog.csdn.net/beyondlpf/article/details/7900306
执行:ln -s /usr/local/lib/libpcre.so.1 /lib64
再次启动nginx,ok!