Author Topic: Apache rebuild doesn't work (again) and workaround  (Read 1293 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Apache rebuild doesn't work (again) and workaround
« on: May 24, 2023, 07:25:38 PM »
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.gz
wget 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


Offline
*****
Re: Apache rebuild doesn't work (again) and workaround
« Reply #1 on: May 26, 2023, 10:43:28 PM »
What version of Apache are you looking for? 2.4.56?

As a quick test, I can curl their older Apache 2.2.27 script:
Code: [Select]
curl -O https://dl1.centos-webpanel.com/files/c_scripts/apache-2.2.27.sh

Offline
*
Re: Apache rebuild doesn't work (again) and workaround
« Reply #2 on: June 21, 2023, 03:36:38 AM »
check disk space i had this issue before, was because my server was full, then i rebooted the server after a failed build and couldnt get access to cwp