Debain源码编译安装nginx

安装pcre-config、

一、

Nginx系列-报错汇总 - 知乎 (zhihu.com)

一、下载地址
链接: https://pan.baidu.com/s/1F37ac03MfStZnGO0DNmKTw  密码: v4ru
二、解压
tar -zxvf pcre-8.35.tar.gz 
三、进入安装目录
cd pcre-8.35
四、编译安装
./configure 
make && make install
五、查看pcre版本
pcre-config --version




安装openssl



二、

./configure: error: SSL modules require the OpenSSL library. - digdeep - 博客园 (cnblogs.com)

安装openresty时报错:./configure: error: SSL modules require the OpenSSL library.


解决办法,下载openssl类库:https://www.openssl.org/source/old/1.1.1/openssl-1.1.1w.tar.gz


解压到 /root/ 目录: /root/openssl-1.1.1w




 然后通过参数指定: --with-openssl=/root/openssl-1.1.1w  



三、

禁用HTTP gzip模块:如果你不需要使用HTTP gzip模块,你可以在运行

禁用HTTP gzip模块:如果你不需要使用HTTP gzip模块,你可以在运行./configure命令时使用

--without-http_gzip_module选项来禁用它:



重新编译安装即可。




编译命令

/configure    --with-stream --with-http_stub_status_module --with-http_ssl_module  --with-openssl=/root/openssl-1.1.1w  --without-http_gzip_module


安装

make

sudo make install



启动nginx报错:error while loading shared libraries:libpcre.so.1:cannot open shared object file:No such file or directory


nginx启动报错处理方法 error while loading shared libraries:libpcre.so.1:cannot open shared object file:No su_error while loading shared libraries: libpcre.so.1-CSDN博客


echo “/root/pcre-8.35/.libs” >> /etc/ld.so.conf

ldconfig