Home Nginx添加ssl模块
Post
Cancel

Nginx添加ssl模块

一、在安装时添加ssl模块

1、进入源码包所在的目录,进行编译,编译时添加参数–with-http_stub_status_module --with-http_ssl_module

1
2
cd /usr/local/nginx-1.20.2
./configure --with-http_stub_status_module --with-http_ssl_module

2、进行编译与编译安装

1
make && make install

3、查看是否含有ssl模块

/usr/local/nginx/sbin/nginx -V

二、在安装好后添加ssl模块

1、进入到源码包所在的目录,进行编译,编译时添加参数./configure --prefix=系统生成的Nginx目录 --with-http_stub_status_module --with-http_ssl_module

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

2、编译(这里不能编译安装)

1
make

3、配置Nginx二进制文件

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

4、停掉Nginx

1
killall nginx

5、替换Nginx二进制文件(新的二进制文件在源码包的objs目录里面)

1
2
cd objs
cp nginx /usr/local/nginx/sbin/

6、查看ssl模块是否已添加

1
/usr/local/nginx/sbin/nginx -V
This post is licensed under CC BY 4.0 by the author.