openssl3已经测试了一段时间了,在官网看到后就想用来安装nginx,以下是我的安装过程。
更新日志:
1. 2023-1-9 更新脚本以及依赖以在Centos7 + 宝塔面板上 成功安装
2. 2023-1-11 支持nginx-quic安装!!!
#####先附上正确方案
mkdir nginx&&cd nginx
curl -O https://hg.nginx.org/nginx-quic/archive/quic.tar.gz
tar -xzvf quic.tar.gz
curl -O https://nchc.dl.sourceforge.net/project/pcre/pcre/8.43/pcre-8.43.tar.bz2
tar -jxvf pcre-8.43.tar.bz2
curl -O http://zlib.net/zlib-1.2.11.tar.gz
tar -vzxf zlib-1.2.11.tar.gz
curl -O https://www.openssl.org/source/old/3.0/openssl-3.0.0-alpha17.tar.gz
tar -xzvf openssl-3.0.0-alpha17.tar.gz
cd openssl-3.0.0-alpha17
./Configure && make -j4
cd ..
cd nginx-quic-quic
./auto/configure --prefix=自行修改 \
--user=自行修改 \
--group=自行修改 \
--with-debug \
--with-http_ssl_module \
--with-http_gzip_static_module \
--with-http_flv_module \
--with-http_mp4_module \
--with-http_v2_module \
--with-stream \
--with-http_sub_module \
--with-http_stub_status_module \
--with-stream_ssl_module \
--with-stream_ssl_preread_module \
--with-openssl=../openssl-3.0.0-alpha17 \
--with-pcre=../pcre-8.43 \
--with-zlib=../zlib-1.2.11 \
--with-cc-opt="-Wno-error -Wno-deprecated-declarations"
make -j4 && make install
宝塔面板一键安装脚本:
curl -O https://gitee.com/qinyinan/share/raw/master/scripts/nginx.sh
bash nginx.sh install 1.23
rm nginx.sh
此处可选多个版本,1.20及以上均可~
目前支持 1.20, 1.23, quic !!!
附上截图!
P.S. Debian GNU/Hurd 安装截图!
P.S. 最新版宝塔面板安装截图
P.S. nginx-quic 安装图
####排错经历
由于我用的是freeBSD作为服务器,网上资源不是很多,而且Openssl 3才出来没有多久。所以当我按照老版本openssl以及nginx的安装方法安装时,就出现了以下报错
-Werror,-Wdeprecated-declarations
编译器会提示API已经弃用了(估计是nginx没有更新代码),并且把所有警告视为了错误,才会报错停止。
####解决方法
在C-flags里加上-Wno-error -Wno-deprecated-declarations即可。