New in CWP Edge-LatestFree with every CWPpro licenceWebsites up to 300x faster

CWP now includes LSPHP, LSAPI-Cache and CWP Cage at no extra cost with all CWPpro licences. The LSAPI-Cache plugin is integrated into our WordPress and other script installers, and CWP Cage gives every user complete isolation. Available now in the CWP Edge-Latest version.

Get CWPpro ›

apache wont restart after enabling mod_security.

Started by mbuchholz, June 25, 2024, 08:51:16 PM

Previous topic - Next topic

mbuchholz

For some reason when you install mod_security the config file for it has an extra line:

LoadFile /usr/lib64/

Which errors out Apache when loading:

httpd: Syntax error on line 512 of /usr/local/apache/conf/httpd.conf: Syntax error on line 2 of /usr/local/apache/conf.d/mod_security.conf: Cannot load /usr/lib64/ into server: /usr/lib64/: cannot read file data: Is a directory


Removing that line makes it load fine.  Not sure if another file was supposed to be loaded by that line.   

Currently testing CWP on Alma Linux 9.4


Thanks!

overseer

EL9 support is still in beta with CWP. Test for that error when it is fully production ready for AlmaLinux 9

Starburst

#2
There seems to be a install problem.

nano /usr/local/apache/conf.d/mod_security.conf

Line 2 – Add – liblua-5.4.so to the end.

systemctl start httpd

kwesiaryee

I am having this same issue after installing cwp on Alma-9.

Can anyone share how they might have solved it?

Starburst

What is the error message Apache is giving?

From what I've seen, the above fixes it.


hatnaa


hatnaa

#7
Its resolved now
edit mod_security.conf
nano /usr/local/apache/conf.d/mod_security.conf


LoadFile /usr/lib64/libxml2.so
LoadFile /usr/lib64/         <<<----------------remove this line.

<IfModule !unique_id_module>
LoadModule unique_id_module modules/mod_unique_id.so
</IfModule>

<IfModule !mod_security2.c>
LoadModule security2_module  modules/mod_security2.so
</IfModule>

<IfModule mod_security2.c>
    <IfModule mod_ruid2.c>
        SecAuditLogStorageDir /usr/local/apache/logs/modsec_audit
        SecAuditLogType Concurrent
    </IfModule>
    <IfModule itk.c>
        SecAuditLogStorageDir /usr/local/apache/logs/modsec_audit
        SecAuditLogType Concurrent
    </IfModule>

Starburst

Actually the fix is to add - liblua-5.4.so
to the end of that line for AlmaLinux.

After it should read:

LoadFile /usr/lib64/liblua-5.4.so

This fix was mentioned above, and has been tested and works on all of our new servers.

victoryel

Quote from: Starburst on August 29, 2024, 11:25:17 AM
Actually the fix is to add - liblua-5.4.so
to the end of that line for AlmaLinux.

After it should read:

LoadFile /usr/lib64/liblua-5.4.so

This fix was mentioned above, and has been tested and works on all of our new servers.

Thank you so much!

venty

Quote from: overseer on June 25, 2024, 11:02:56 PM
EL9 support is still in beta with CWP. Test for that error when it is fully production ready for AlmaLinux 9

Hi,

Is AL9 support with CWP still beta?

AL?

BR
Venty

Starburst

#11
All new servers we've activated have AL9 (AlmaLinux 9).

It installs a little different, but seems to be working well.
If you need PHP below 7.4, then you'll still have to install CWP on AL8 (AlmaLinux 8 )

[Edited for typeo's]

venty

Quote from: Starburst on October 24, 2024, 09:32:33 AM
All new servers we've activated have AL9 (AlmaLinux 9).

It installs a little different, but seems to be working well.
If you need PHP below 7.4, then you'll still have to install CWP on AL8 (AlmaLinux 8 )

[Edited for typeo's]

Hi,

you last recommended me this installation:

https://forum.centos-webpanel.com/apache/issues-with-brand-new-fresh-install-with-almalinux-9-4/msg49150/#msg49150

but at the end it says that you are using an internal installation guide:

"We are always tweaking the AL9 install process, that's just a small fraction of the current AL9 internal guide we use that is 12 pages long. :/"

....is it possible to have a look at it....

Thanks in advance!

BR
Venty

Starburst

The only things not mentioned in the link where like setting the time zone, DNS servers, setting hostname, adding SWAP (if needed), Kernel upgrade, upgrading MariaDB, security tweaks, and install monitoring and reporting tools.

Everyone has their own preferences when it comes to stuff like that.


Here are some links for updates that we would recommend after a new installation:

https://www.alphagnu.com/topic/43-disable-php-mail-function-in-cwp-%E2%80%93-control-webpanel/

https://www.alphagnu.com/topic/24-cwp-%E2%80%93-control-web-panel-install-latest-apache-2462-version/

https://www.alphagnu.com/topic/28-cwp-apache-restore-original-visitor-ips-with-mod_remoteip-when-using-cloudflare-proxy/

https://www.alphagnu.com/topic/33-update-cwp-roundcube-mail-version-156-%E2%80%93-control-web-panel/

https://www.alphagnu.com/topic/508-solution-for-returning-attackers-when-restarting-csf/


CWP has a support wiki on how to upgrade MariaDB also.
The current 2 LTS are 10.11 and 11.4.

Namaste

So my mod config already had the correction stated about.

LoadFile /usr/lib64/liblua-5.4.so ...and that didnt fix it.

I uninstalled modsec and apache server is back on line.  I got a journal syntax error referring to line 512 in httpd config.  When modsecurity was installed it appended to lines and saved the original config file.  the only difference was the addition of 3 lines at the end of the apache config file.

ExtendedStatus On
Include /usr/local/apache/conf/sharedip.conf
Include /usr/local/apache/conf.d/*.conf
Listen to everything Pixelpadre says.