Nginx安装ngxhttpsslmodule模块使其支持SSLhttps
# 例如
- nginx安装目录: /usr/local/nginx/
- nginx源码目录: /data/nginx-1.26.1/
# 查看是否开启ssl模块
如出现下面信息,则没有安装该模块
[root@YMYSZ-1 sbin]# ./nginx -V
nginx version: nginx/1.26.1
built by gcc 7.3.0 (GCC)
configure arguments:
1
2
3
4
2
3
4
# 开始安装ssl模块
- 关闭nginx
systemctl stop nginx.service
# 或者
cd /usr/local/nginx/sbin
./nginx -s stop
# 或者
kill $(ps aux | grep 'nginx: worker process' | grep -v grep | awk '{print $2}')
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
- 切换到源码目录
cd /data/nginx-1.26.1
1
- 执行命令
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
1
- 编译 (这里不要进行make install,否则就是覆盖安装)
make
1
- 备份原来nginx配置文件
cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak
1
- 将刚生成的配置覆盖原来的配置,若提示是否覆盖,输入
yes
即可。
cp ./objs/nginx /usr/local/nginx/sbin/
1
- 启动nginx
cd /usr/local/nginx/sbin
1
- 启动
./nginx
1
# 再次查看是否开启ssl模块
如出现下面信息,则安装成功
[root@YMYSZ-1 sbin]# ./nginx -V
nginx version: nginx/1.26.1
built by gcc 7.3.0 (GCC)
built with OpenSSL 1.1.1-pre2 (alpha) 27 Feb 2018 (running with OpenSSL 1.1.1f 31 Mar 2020)
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
1
2
3
4
5
6
2
3
4
5
6
上次更新: 2024/08/13, 18:49:18
- 02
- Node与GLIBC_2.27不兼容解决方案08-19
- 03
- Git清空本地文件跟踪缓存08-13