源码安装nginx 并添加https和stream模块
- 准备源码安装的介质
介质名称 | 作用 |
---|---|
nginx | nginx的作用 |
PCRE | 让 Nginx 支持 Rewrite 功能 |
zlibs | Zlib是一个压缩和解压模块,使用这个模块可以做很多事情。 |
openssl | openssl作用 |
介质下载地址 提取码: z8tq
- 编译安装
将介质下载 并上传到服务器
tar -zxvf pcre-8.45.tar.gz -C ./dep/
cd ./dep/pcre-8.45/
./configure
make
make install
...
以此类推 编译安装 zlibs和openssl
最后安装nginx时 编译的路径需要指定
./configure --with-http_ssl_module --with-stream --prefix='指定nginx安装的路径'
然后make && make install
启动nginx如果报错:
openssl: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
执行命令
ln -s /usr/local/lib64/libssl.so.1.1 /usr/lib64/libssl.so.1.1
ln -s /usr/local/lib64/libcrypto.so.1.1 /usr/lib64/libcrypto.so.1.1
# 重新建立关系后 查看openssl版本
openssl version
- 启动nginx
./nginx
ps -ef | grep nginx
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。