0

Getting the below issue with including mod_brotli support for Apache 2.4.33.

I compiled brotli which compiled fine but when i enable it in apache configure script using --enable-brotli and --with-brotli=/apps/httpdx64/brotli. I get the below error message when the apache is compiled:

/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
/usr/bin/ld: cannot find -lbrotlienc
collect2: ld returned 1 exit status
make[3]: *** [mod_brotli.la] Error 1
make[3]: Leaving directory `/apps/httpdx64/httpd-2.4.33/modules/filters'
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory `/apps/httpdx64/httpd-2.4.33/modules/filters'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/apps/httpdx64/httpd-2.4.33/modules'
make: *** [install-recursive] Error 1

Please advise on how i can fix this error.

Barry Pollard
  • 40,655
  • 7
  • 76
  • 92
AR01
  • 21
  • 5

1 Answers1

0

Not sure why you have the brotli path set to your httpd folder (--with-brotli=/apps/httpdx64/brotli)?

I compile it like this (as I explain here):

#You may need to install some dependencies if not already installed on your machine.
#For Centos/RHEL 7 the following should do this for you:
sudo yum install wget
sudo yum install perl
sudo yum install gcc
sudo yum install pcre-devel
sudo yum install cmake.x86_64   

cd ~
mkdir sources
cd sources

#Download and install brotli
git clone https://github.com/google/brotli.git
cd brotli/
git checkout v1.0
mkdir out && cd out
../configure-cmake
make
make test
sudo make install

#Download and install the latest Apache (needs to be 2.4.26 or above)
#For example:
wget http://mirrors.whoishostingthis.com/apache/httpd/httpd-2.4.33.tar.gz
wget https://www.apache.org/dist/httpd/httpd-2.4.33.tar.gz.asc
#Verify the package after download:
gpg --verify httpd-2.4.33.tar.gz.asc)
tar -zxvf httpd-2.4.33.tar.gz
cd httpd-2.4.33
./configure --with-pcre=/usr/bin/pcre-config --enable-ssl --enable-so --enable-brotli --with-brotli=/usr/local/brotli
make
sudo make install

Thanks, Barry

Barry Pollard
  • 40,655
  • 7
  • 76
  • 92
  • I compile my own pcre, apr, apr-util, openssl from source code and include them into my apache build. I am following the same process for brotli. I do not want to depend on the binaries installed on the OS. I have seen dependency issues when the system libraries are upgraded that is reason i am compiling my own and including them with my apache binaries. Also brotli is not available as a standard package from the UNIX team. I compile the software required for Apache. This Apache rpm is consumed by the customers via yum. – AR01 Apr 25 '18 at 15:35