zoukankan      html  css  js  c++  java
  • nginx如果未开启SSL模块,配置https时提示错误

    nginx: [emerg] unknown directive "ssl" in /usr/local/nginx/conf/nginx.conf:41
    nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed

    这是因为nginx缺少http_ssl_module模块,编译安装时带上淡出--with-http_ssl_module配置就行了,但是如果已经安装过了nginx,怎么添加模块呢?

    1.切换到源码包:

      cd /opt/nginx/nginx-1.10.2/(替换为自己的源码包目录即可)

    2.查看nginx原有的模块

      nginx -V

      原有配置信息如下:

        --pref=/usr/local/nginx

    3.运行命令:./configure --pref=/usr/local/nginx --with-http_ssl_module

    4.运行make(这里不要make install,否则会覆盖安装)

    5.备份原有已安装好的nginx:cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak

    6.停止nginx运行:nginx -s stop

    7.将刚刚编译好的nginx覆盖掉原有的nginx:cp ./objs/nginx /usr/local/nginx/sbin/nginx

    8.启动nginx:nginx

    9.运行:nginx -V 查看是否已成功加入

  • 相关阅读:
    面试1
    初级算法-数组1
    程序员常用单词
    SpringBoot
    JDBC
    animate.css 实现 网页滚动指定位置添加动画
    解决打包上线缓存问题
    组件之间双向绑定
    按照给定数组排序原数组
    扩展运算符... 的使用
  • 原文地址:https://www.cnblogs.com/houkaihua/p/11779147.html
Copyright © 2011-2022 走看看