./configure: error: SSL modules require the OpenSSL library. You can e

[复制链接]
发表于 2024-10-2 02:30:04 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
 Ubuntu22体系,参考nginx文档Support for QUIC and HTTP/3 执行如下命令:
  1. ./configure
  2.     --with-debug
  3.     --with-http_v3_module
  4.     --with-cc-opt="-I../boringssl/include"
  5.     --with-ld-opt="-L../boringssl/build/ssl
  6.                    -L../boringssl/build/crypto"
复制代码
时报错如下:
  1. ./configure: error: SSL modules require the OpenSSL library.
  2. You can either do not enable the modules, or install the OpenSSL library
  3. into the system, or build the OpenSSL library statically from the source
  4. with nginx by using --with-openssl=<path> option.
复制代码
但着实体系是有openssl库的:
➜  out gitv1.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即可,具体步调如下:
  1. git clone --recurse-submodules -j8 https://github.com/google/ngx_brotli
  2. cd ngx_brotli/deps/brotli
  3. mkdir out && cd out
  4. 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 ..
  5. cmake --build . --config Release --target brotlienc
  6. cd ../../../..
  7. hg clone https://hg.nginx.org/nginx
  8. cd nginx
  9. ./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'
  10. make
  11. sudo make install
  12. cd /usr/sbin
  13. sudo ln -s /www/server/nginx/sbin/nginx
  14. nginx -version
  15. # nginx version: nginx/1.25.5
复制代码


免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
继续阅读请点击广告
回复

使用道具 举报

© 2001-2025 Discuz! Team. Powered by Discuz! X3.5

GMT+8, 2025-7-19 06:27 , Processed in 0.072957 second(s), 29 queries 手机版|qidao123.com技术社区-IT企服评测▪应用市场 ( 浙ICP备20004199 )|网站地图

快速回复 返回顶部 返回列表