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_modulenginx version: nginx/1.18.0built 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-bakcp /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