我试图使用certbot设置我的https,所以我需要重新编译ngx添加'——with-http_ssl_module',以下是完整的步骤:
- sudo make clean
- sudo ./auto/configure --prefix=/var/www/html --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --with-pcre --with-http_ssl_module --lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid --modules-path=/etc/nginx/modules
- check Makefile , I can see 'http_ssl_module' added in objs/Makefile
- sudo make
- sudo make install
完成以上所有步骤后(没有观察到错误)
我检查”ngx_modules。O '(仍然缺少SSL模块),并运行下面的命令
sudo certbot --nginx -d feedme.pub
Saving debug log to /var/log/letsencrypt/letsencrypt.log
The nginx plugin is not working; there may be problems with your existing configuration.
The error was: PluginError('Nginx build is missing SSL module (--with-http_ssl_module).')
我还检查了我的ssl lib- libssl是安装:
ldconfig -p | grep libssl
libssl3.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libssl3.so
libssl.so.1.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libssl.so.1.1
libssl.so.1.0.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0
libssl.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libssl.so
任何人可以帮助回答为什么我不能构建'——with-http_ssl_module'在?
下面是解决方案:
在。/ configuration中添加了步骤
——with-openssl=/usr/include/openssl' options since '——with-http_ssl_module'需要使用openssl
当构建时,我得到了另一个错误:
make -f objs/Makefile
make[1]: Entering directory `/root/soft/nginx-1.17.3'
cd /usr/local/openssl \
&& if [ -f Makefile ]; then make clean; fi \
&& ./config --prefix=/usr/local/openssl/.openssl no-shared no-threads \
&& make \
&& make install_sw LIBDIR=lib
/bin/sh: line 2: ./config: No such file or directory
make[1]: *** [/usr/local/openssl/.openssl/include/openssl/ssl.h] Error 127 make[1]: Leaving directory `
我所做的就是手动修改
./auto/lib/openssl/conf
将下面的路径更改为我的ubuntu的实际位置
CORE_INCS="$CORE_INCS <your openssl lib's path>/include"
CORE_DEPS="$CORE_DEPS <your openssl lib's path>/include/openssl/ssl.h"
CORE_LIBS="$CORE_LIBS <your local libssl.a path>/lib/libssl.a"
CORE_LIBS="$CORE_LIBS <your local libcrypto.a path>/lib/libcrypto.a"
那就跑吧,把一切都解决了