Apache Won’t Start After Enabling ModSecurity
INTRODUCTION
If you receive the following error in CWP after enabling ModSecurity for Apache on AlmaLinux 9:
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
There seems to be a install problem with the current beta version of CWP on AlmaLinux 9, as of the initial writing of this article.
READ ME FIRST
This article is provided as a courtesy.
Installing, configuring, and troubleshooting third-party applications is outside the scope of basic support provided by Starburst Services.
We are not liable for any damages and/or data loss.
REQUIRMENTS
- SSH credentials or File Manager access Logged In as Root
- Text editor of your choice. (The example uses nano)
PROCEDURE
STEP 1
Edit the ModSecurity configuration file:
nano /usr/local/apache/conf.d/mod_security.conf
At the End of Line 2, Add the following: liblua-5.4.so
Using the nano editor, Use Ctrl-O
to Save, and Ctrl-X
to Exit.
STEP 2
Now Start Apache:
systemctl start httpd
Configuration is complete.
You are ready to go.
Thanks for learning with Starburst Services.
Did you found this Knowledge Base Article useful?
Please considering thanking our SysOp Team.
KB Article Written: 2024-06-27
KB Article Updated: 2024-07-10