Heartsuit's Simple Blog

A place to hold mainly reading notes, and some technical stuff occasionally. 这里主要是一些读书笔记、感悟;还有部分技术相关的内容。


Project maintained by heartsuit Hosted on GitHub Pages — Theme by mattgraham

nginx:emerg the 'ssl' parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/nginx.conf:42

目录[-]

背景

Nginx 配置了 HTTPS ,启动报错:

nginx: [emerg] the "ssl" parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/nginx.conf:42

提示 Nginx 缺少 http_ssl_module 模块。

解决

nginx -V

configure arguments: –prefix=/usr/local/nginx –pid-path=/var/run/nginx/nginx.pid –lock-path=/var/lock/nginx.lock –error-log-path=/var/log/nginx/error.log –http-log-path=/var/log/nginx/access.log –with-http_gzip_static_module –http-client-body-temp-path=/var/temp/nginx/client –http-proxy-temp-path=/var/temp/nginx/proxy –http-fastcgi-temp-path=/var/temp/nginx/fastcgi –http-uwsgi-temp-path=/var/temp/nginx/uwsgi –http-scgi-temp-path=/var/temp/nginx/scgi –add-module=/root/FastDFS/fastdfs-nginx-module/src

确实没有 http_ssl_module 模块。。

# 进入Nginx源码目录
cd /root/FastDFS/nginx-1.12.2

# 附加--with-http_ssl_module
./configure --prefix=/usr/local/nginx --pid-path=/var/run/nginx/nginx.pid --lock-path=/var/lock/nginx.lock --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-http_gzip_static_module --http-client-body-temp-path=/var/temp/nginx/client --http-proxy-temp-path=/var/temp/nginx/proxy --http-fastcgi-temp-path=/var/temp/nginx/fastcgi --http-uwsgi-temp-path=/var/temp/nginx/uwsgi --http-scgi-temp-path=/var/temp/nginx/scgi --add-module=/root/FastDFS/fastdfs-nginx-module/src --with-http_ssl_module

# 运行make命令
make

# 备份
cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak

# 停止
nginx -s stop

# 新编译的Nginx覆盖原来的Nginx
cp ./objs/nginx /usr/local/nginx/sbin/

# 启动Nginx
nginx

# 再次查看已安装模块,确认是否成功
nginx -V

http_ssl_module 模块安装成功:

2021-03-15-NginxSSL.png


If you have any questions or any bugs are found, please feel free to contact me.

Your comments and suggestions are welcome!


「说点什么吧😊~~😊」: