手动安装Nginx报错
checking for C compiler … not found
报错:
1 | root@Test-Learn:~/learn/nginx-1.22.0# ./configure |
解决:apt install -y gcc g++
PCRE library
报错:
1 | ./configure: error: the HTTP rewrite module requires the PCRE library. |
解决:
- debain
apt install -y libpcre3 libpcre3-dev
- centos:
yum install pcre pcre-devel
zlib library
报错:
1 | ./configure: error: the HTTP gzip module requires the zlib library. |
解决:
- debain
apt install -y zlib1g zlib1g-dev
- centos:
yum install zlib zlib-devel
missing make
报错:
1 | root@Test-Learn:~/learn/nginx-1.22.0# make |
解决:apt install -y make
nginx: [emerg] unknown directive “ssl”
首先先关闭nginx
解决:不存在ssl模块,重新解压编译ssl模块
查看原有模块:
/usr/local/nginx/sbin/nginx -V
重新编写配置信息,在原有模块之后增加:
--with-http_ssl_module
示例:
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
make
-> 之后不要执行install备份原有Nginx
复制编译的新nginx(obj目录里)到原来位置