Score:0

Apache Server on Ubuntu 22.04 crashes when I enable ModSecurity

hu flag

I am building a server on Ubuntu 22.04 with Apache2 - latest version. When I enable ModSecurity, I get an error message when I try to restart apache. As soon as I disable ModSecurity, the error message goes away when restarting apache and my website is back online. Any suggestions?

Details:

× apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset:>
     Active: failed (Result: exit-code) since Wed 2022-11-23 13:16:04 CST; 8min a>
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 2799 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAIL>
        CPU: 31ms

More Details:

Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ An ExecStart= process belonging to unit apache2.service has exited.
░░ 
░░ The process' exit code is 'exited' and its exit status is 1.
Nov 23 13:16:04 m-70A4003AUX systemd[1]: apache2.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ The unit apache2.service has entered the 'failed' state with result 'exit-code'.
Nov 23 13:16:04 m-70A4003AUX systemd[1]: Failed to start The Apache HTTP Server.
░░ Subject: A start job for unit apache2.service has failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ A start job for unit apache2.service has finished with a failure.
░░ 
░░ The job identifier is 2140 and the job result is failed.
Score:0
id flag

Have You run apachectl configtest?

https://coreruleset.org/installation/

Important Notice: From CRS 3.2.2, 3.3.3 and up, ModSecurity 2.9.6 or 3.0.8 (or versions with backported patches) are required due to the addition of new protections. We recommend upgrading your ModSecurity as soon as possible. If your ModSecurity is too old, your webserver will refuse to start. As a temporary measure, you can delete file rules/REQUEST-922-MULTIPART-ATTACK.conf. However, you will be missing some protections.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.