当前位置:   article > 正文

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

ssl modules require the openssl library. you can either do not enable the mo

 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"

时报错如下:

  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 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即可,具体步骤如下:

  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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/人工智能uu/article/detail/737010
推荐阅读
相关标签
  

闽ICP备14008679号