編譯openssl
從github下載指定版本的源碼 https://github.com/openssl/openssl/releases
-
下載后解壓
tar -zcvf openssl-3.1.1.tar.gz
-
進(jìn)入文件夾后配置
cd openssl-3.1.1 && ./Configure --prefix=/data/projects/build/openssl-3.1.1
--prefix參數(shù)指定路徑
-
執(zhí)行編譯
make -j8
-
不需要安裝到系統(tǒng),此時(shí)當(dāng)前目錄下面會(huì)有
libssl.so和libcrypto.so
編譯nginx
從github下載指定版本的源碼 https://github.com/nginx/nginx/tags
- 下載后解壓
tar -zcvf nginx-release-1.25.0.tar.gz
- 進(jìn)入文件夾后配置
cd nginx-release-1.25.0
- 執(zhí)行配置
./auto/configure --prefix=/data/projects/nginx --with-http_v2_module \
--with-http_ssl_module \
--with-openssl=/data/projects/build/openssl-3.1.1
-
執(zhí)行編譯
make -j8
文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-549388.html -
最后在當(dāng)前目錄的objs下面會(huì)生成nginx可執(zhí)行文件
objs/nginx
文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-549388.html
啟動(dòng)nginx
nginx -c /xxx/nginx.conf
到了這里,關(guān)于源碼編譯nginx支持https的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!