当前位置: 代码网 > it编程>编程语言>Javascript > ./configure: error: SSL modules require the OpenSSL library. You can either do not enable the module

./configure: error: SSL modules require the OpenSSL library. You can either do not enable the module

2024年08月02日 Javascript 我要评论
Ubuntu22系统,参考nginx文档。

 ubuntu22系统,参考nginx文档support for quic and http/3 执行如下命令:

./configure
    --with-debug
    --with-http_v3_module
    --with-cc-opt="-i../boringssl/include"
    --with-ld-opt="-l../boringssl/build/ssl
                   -l../boringssl/build/crypto"

时报错如下:

./configure: error: ssl modules require the openssl library.
you can either do not enable the modules, or install the openssl library
into the system, or build the openssl library statically from the source
with nginx by using --with-openssl=<path> option.

但其实系统是有openssl库的:

➜  out git:(v1.1.0) ✗ openssl version
openssl 3.0.2 15 mar 2022 (library: openssl 3.0.2 15 mar 2022)

必应了一下,参考了这两个:https://forum.nginx.org/read.php?2,299223  #2605 (nginx + boringssl build error (nginx 1.25.4 required openssl)) – nginx

编译nginx时指定为c++ linker即可,具体步骤如下:

git clone --recurse-submodules -j8 https://github.com/google/ngx_brotli
cd ngx_brotli/deps/brotli
mkdir out && cd out
cmake -dcmake_build_type=release -dbuild_shared_libs=off -dcmake_c_flags="-ofast -m64 -march=native -mtune=native -flto -funroll-loops -ffunction-sections -fdata-sections -wl,--gc-sections" -dcmake_cxx_flags="-ofast -m64 -march=native -mtune=native -flto -funroll-loops -ffunction-sections -fdata-sections -wl,--gc-sections" -dcmake_install_prefix=./installed ..
cmake --build . --config release --target brotlienc
cd ../../../..

hg clone https://hg.nginx.org/nginx
cd nginx
./auto/configure --user=www --group=www --prefix=/www/server/nginx --with-pcre --add-module=../ngx_brotli --with-http_v2_module --with-stream --with-stream_ssl_module --with-http_ssl_module --with-http_gzip_static_module --with-http_gunzip_module --with-http_sub_module --with-http_flv_module --with-http_addition_module --with-http_realip_module --with-http_mp4_module --with-ld-opt='-wl,-e' --with-cc-opt=-wno-error --with-ld-opt='-ljemalloc' --with-http_dav_module --with-http_v3_module --with-cc=c++ --with-cc-opt='-i ../boringssl/include -x c' --with-ld-opt='-l../boringssl/build/ssl -l../boringssl/build/crypto'
make 
sudo make install
cd /usr/sbin
sudo ln -s /www/server/nginx/sbin/nginx
nginx -version
# nginx version: nginx/1.25.5

(0)

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2025  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com