nginx报错:./configure: error: SSL modules require the OpenSSL library. You can either
在nginx中配置监听443端口后重新加载配置文件出现此报错,
原因:未安装 ngx_http_ssl_module 模块文章来源:https://www.toymoban.com/news/detail-751358.html
解决方法:文章来源地址https://www.toymoban.com/news/detail-751358.html
#执行命令查看nginx是否安装了 ngx_http_ssl_module
/app/nginx/sbin/nginx -V
#出现以下内容则说明未安装 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,依次执行以下命令
cd /install/nginx/nginx-1.18.0
./configure --prefix=/usr/local/nginx
./configure --with-http_ssl_module
#这里若出现报错提示以下信息:
#/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
#安装完成后再次执行./configure --with-http_ssl_module
#最后编译
make && make install
#编译完成后可通过命令查看ngx_http_ssl_module是否安装成功
/usl/local/nginx/sbin/nginx -V
#出现以下内容则安装完成
#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进行备份
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
到了这里,关于nginx报错:./configure: error: SSL modules require the OpenSSL library. You can either的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!