TypechoJoeTheme

香草物语

统计
登录
用户名
密码
/
注册
用户名
邮箱
输入密码
确认密码

nginx:[emerg]unknown directive "ssl"

Laughing博主
2018-04-23
/
0 评论
/
1,321 阅读
/
71 个字
/
百度已收录
04/23
本文最后更新于2020年09月25日,已超过1455天没有更新。如果文章内容或图片资源失效,请留言反馈,我会及时处理,谢谢!

在centos中,配置nginx的https时,出现如下错误。

nginx: [emerg] unknown directive "ssl" in /usr/local/nginx/conf/nginx.conf:102

到解压的nginx目录下

./configure --with-http_ssl_module

当执行上面语句,出现

./configure: error: SSL modules require the OpenSSL library.

yum -y install openssl openssl-devel

再执行

./configure

重新执行

./configure --with-http_ssl_module
make

切记不能make install 会覆盖。

把原来nginx备份

cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak

把新的nginx覆盖旧的

cp objs/nginx /usr/local/nginx/sbin/nginx

出现错误时

cp: cannot create regular file ‘/usr/local/nginx/sbin/nginx’: Text file busy

cp -rfp objs/nginx /usr/local/nginx/sbin/nginx解决

测试nginx是否正确

/usr/local/nginx/sbin/nginx -t

(nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful)

重启nginx

/usr/local/nginx/sbin/nginx -s reload

Nginx
朗读
赞(1)
赞赏
感谢您的支持,我会继续努力哒!
版权属于:

香草物语

本文链接:

https://www.xiangcaowuyu.net/blog/nginxemergunknown-directive-ssl.html(转载时请注明本文出处及文章链接)

评论 (0)
  1. 365dd 闲逛
    Windows 10 · Google Chrome

    看看密码

    2019-10-19 回复
  2. yydngs 闲逛
    Windows 10 · Google Chrome

    看看一下

    2018-12-26 回复