当前位置:   article > 正文

nginx报错:./configure: error: SSL modules require the OpenSSL library. You can either

./configure: error: ssl modules require the openssl library. you can either

nginx报错:./configure: error: SSL modules require the OpenSSL library. You can either

在nginx中配置监听443端口后重新加载配置文件出现此报错,

原因:未安装 ngx_http_ssl_module 模块

解决方法:

#执行命令查看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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号