nginx報錯:./configure: error: SSL modules require the OpenSSL library. You can either
在nginx中配置監(jiān)聽443端口后重新加載配置文件出現(xiàn)此報錯,
原因:未安裝 ngx_http_ssl_module 模塊文章來源:http://www.zghlxwxcb.cn/news/detail-751358.html
解決方法:文章來源地址http://www.zghlxwxcb.cn/news/detail-751358.html
#執(zhí)行命令查看nginx是否安裝了 ngx_http_ssl_module
/app/nginx/sbin/nginx -V
#出現(xiàn)以下內(nèi)容則說明未安裝 ngx_http_ssl_module
nginx version: nginx/1.18.0
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
configure arguments: --prefix=/app/nginx
#找到nginx安裝目錄,我的目錄在/install/nginx/nginx-1.18.0,依次執(zhí)行以下命令
cd /install/nginx/nginx-1.18.0
./configure --prefix=/usr/local/nginx
./configure --with-http_ssl_module
#這里若出現(xiàn)報錯提示以下信息:
#/configure: error: SSL modules require the OpenSSL library.
#You can either do not enable the modules, or install the OpenSSL library into the system, or build the OpenSSL library statically from the source with nginx by using --with-openssl= option.
#說明未安裝Openssl
#可通過yum安裝
yum install openssl openssl-devel -y
#安裝完成后再次執(zhí)行./configure --with-http_ssl_module
#最后編譯
make && make install
#編譯完成后可通過命令查看ngx_http_ssl_module是否安裝成功
/usl/local/nginx/sbin/nginx -V
#出現(xiàn)以下內(nèi)容則安裝完成
#nginx version: nginx/1.18.0
#built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
#configure arguments: --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_stub_status_module
#將原始的/app/nginx/sbin/nginx進(jìn)行備份
mv /app/nginx/sbin/nginx /app/nginx/sbin/nginx-bak
cp /usr/local/nginx/sbin/nginx /app/nginx/sbin/nginx
#啟動nginx,并指定配置文件為/app/nginx/conf/nginx.conf
/app/nginx/sbin/nginx -c /app/nginx/conf/nginx.conf
到了這里,關(guān)于nginx報錯:./configure: error: SSL modules require the OpenSSL library. You can either的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!