软件系统开发定制nginx启动报 ssl parameter requires ngx_http_ssl_module

启动报"ssl parameter requires ngx_http_ssl_module"

1、问题现象

服务器nginx 软件系统开发定制引入配置时,报错:

[emerg] the “ssl” parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/vhost/crm.conf:3

2、问题分析

原因:nginx缺少http_ssl_module模块,软件系统开发定制编译安装的时候带上–with-http_ssl_module配置就行了,但是现在的情况是我的nginx已经安装过了,怎么添加模块?以我的nginx为例子
①nginx的安装目录是/usr/local/nginx这个目录,
②源码包在/usr/local/src/nginx-1.8.0目录

3、解决过程

注:

1、如果是使用yum 安装等方式,找不到源码包,需要下载当前安装相同版本的源码包:

wget http://nginx.org/download/nginx-1.8.0.tar.gz
  • 1

使用nginx -V查询当前Nginx的编译配置信息,configure arguments: 后面为当前运行Nginx的配置信息

(base) [root@iZxpl4sxxnloovZ nginx-1.8.0]# nginx -Vnginx version: nginx/1.8.0built by gcc 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) configure arguments: --prefix=/usr/local/nginx
  • 1
  • 2
  • 3
  • 4

2、 切换到源码目录:

./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
  • 1

执行结果如下:

(base) [root@iZxpl4sxxnloovZ nginx-1.8.0]# ./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_modulechecking for OS + Linux 3.10.0-1062.9.1.el7.x86_64 x86_64checking for C compiler ... found + using GNU C compiler + gcc version: 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)   ... 省略部分  nginx http proxy temporary files: "proxy_temp"  nginx http fastcgi temporary files: "fastcgi_temp"  nginx http uwsgi temporary files: "uwsgi_temp"  nginx http scgi temporary files: "scgi_temp"
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

3、编译 : make (这里不要进行make install,否则就是覆盖安装)

(base) [root@iZxpl4sxxnloovZ nginx-1.8.0]# makemake -f objs/Makefilemake[1]: Entering directory `/usr/local/src/nginx-1.8.0'cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \        -o objs/src/core/nginx.o \        src/core/nginx.ccc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \        -o objs/src/core/ngx_log.o \
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

4、 备份原来nginx配置文件

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

5、保证nginx是关闭状态
nginx -s stop
如果无法关闭,可以使用杀死进程方式关闭:ps -elf | grep nginx
进程

强制退出:pkill -9 nginx

6、复制刚编译生成的配置覆盖原有的配置

cp ./objs/nginx /usr/local/nginx/sbin/
  • 1

7、启动nginx : nginx

参考文章:https://www.jianshu.com/p/9e81818028b7

网站建设定制开发 软件系统开发定制 定制软件开发 软件开发定制 定制app开发 app开发定制 app开发定制公司 电商商城定制开发 定制小程序开发 定制开发小程序 客户管理系统开发定制 定制网站 定制开发 crm开发定制 开发公司 小程序开发定制 定制软件 收款定制开发 企业网站定制开发 定制化开发 android系统定制开发 定制小程序开发费用 定制设计 专注app软件定制开发 软件开发定制定制 知名网站建设定制 软件定制开发供应商 应用系统定制开发 软件系统定制开发 企业管理系统定制开发 系统定制开发