mod_brotli和apache 2.4.33的编译问题

htzpubme  于 2023-10-23  发布在  Apache
关注(0)|答案(1)|浏览(196)

在Apache 2.4.33中包含mod_brotli支持时出现以下问题。
我编译了brotli,它编译得很好,但是当我在apache配置脚本中使用--enable-brotli--with-brotli=/apps/httpdx64/brotli启用它时。当Apache编译时,我得到下面的错误消息:

  1. /apps/httpdx64/apr/build-1/libtool --silent --mode=link gcc -std=gnu99 -I/usr/include/libxml2 -I/apps/httpdx64/brotli/include -g -O2 -pthread -DSSL_EXPERIMENTAL_ENGINE -L/apps/httpdx64/apache24/openssl/lib -L/usr/lib64 -L/apps/httpdx64/expat/lib -o mod_brotli.la -rpath /apps/httpdx64/apache24/modules -module -avoid-version mod_brotli.lo -L/apps/httpdx64/brotli/lib -lbrotlienc -lbrotlicommon -export-symbols-regex brotli_module
  2. /usr/bin/ld: cannot find -lbrotlienc
  3. collect2: ld returned 1 exit status
  4. make[3]: *** [mod_brotli.la] Error 1
  5. make[3]: Leaving directory `/apps/httpdx64/httpd-2.4.33/modules/filters'
  6. make[2]: *** [install-recursive] Error 1
  7. make[2]: Leaving directory `/apps/httpdx64/httpd-2.4.33/modules/filters'
  8. make[1]: *** [install-recursive] Error 1
  9. make[1]: Leaving directory `/apps/httpdx64/httpd-2.4.33/modules'
  10. make: *** [install-recursive] Error 1

请告诉我如何修复这个错误。

ffdz8vbo

ffdz8vbo1#

不知道为什么你有brotli路径设置为您的httpd文件夹(--with-brotli=/apps/httpdx64/brotli)?
我这样编译它(作为I explain here):

  1. #You may need to install some dependencies if not already installed on your machine.
  2. #For Centos/RHEL 7 the following should do this for you:
  3. sudo yum install wget
  4. sudo yum install perl
  5. sudo yum install gcc
  6. sudo yum install pcre-devel
  7. sudo yum install cmake.x86_64
  8. cd ~
  9. mkdir sources
  10. cd sources
  11. #Download and install brotli
  12. git clone https://github.com/google/brotli.git
  13. cd brotli/
  14. git checkout v1.0
  15. mkdir out && cd out
  16. ../configure-cmake
  17. make
  18. make test
  19. sudo make install
  20. #Download and install the latest Apache (needs to be 2.4.26 or above)
  21. #For example:
  22. wget http://mirrors.whoishostingthis.com/apache/httpd/httpd-2.4.33.tar.gz
  23. wget https://www.apache.org/dist/httpd/httpd-2.4.33.tar.gz.asc
  24. #Verify the package after download:
  25. gpg --verify httpd-2.4.33.tar.gz.asc)
  26. tar -zxvf httpd-2.4.33.tar.gz
  27. cd httpd-2.4.33
  28. ./configure --with-pcre=/usr/bin/pcre-config --enable-ssl --enable-so --enable-brotli --with-brotli=/usr/local/brotli
  29. make
  30. sudo make install

谢谢,巴里

展开查看全部

相关问题