When I try to recompile apache, the log says
Nothing to do
Apache Rebuild Completed
But apache is not compiled.
The url apachesource="
http://dl1.centos-webpanel.com/files/apache/httpd-$version.tar.gz" is broken.
Workaround is replace this url in the file generated from CWP GUI when you try to recompile /usr/local/src/apache-rebuild.sh
In line 9 replace
apachesource="
http://dl1.centos-webpanel.com/files/apache/httpd-$version.tar.gz"
with this:
apachesource="
https://archive.apache.org/dist/httpd/httpd-$version.tar.gz"
Now apache is compiled with the new modules but fails to start:
Syntax error on line 9 of /usr/local/apache/conf.d/mod_security.conf: Cannot load modules/mod_security2.so into server: /usr/local/apache/modules/mod_security2.so: undefined symbol: apr_crypto_block_cleanup
I solved follow the guide of user warwicknz in this forum:
- Install modsecurity through CWP GUI so it generates the main config and OWASP rules
- Then reinstall mod_security2 manually to overwrite the issue with mod_security.so:
#Download ModSecurity
wget
https://www.modsecurity.org/tarball/2.9.1/modsecurity-2.9.1.tar.gzwget
https://www.modsecurity.org/tarball/2.9.1/modsecurity-2.9.1.tar.gz.sha256#Config checksum of download
sha256sum -c modsecurity-2.9.1.tar.gz.sha256
#Install ModSecurity:
tar -xvf modsecurity-2.9.1.tar.gz
cd modsecurity-2.9.1
./configure --with-apxs=/usr/local/apache/bin/apxs
make
sudo make install
cp /usr/local/modsecurity/lib/mod_security2.so /usr/local/apache/modules
Restart Apache, fixed!
I hope it’s useful until they fix it