Symptoms
Running /usr/local/cpanel/scripts/rebuildhttpdconf
produces the following error:
Configuration problem detected on line 152 of file /etc/apache2/conf/httpd.conf.work.xxxxxxx:
Invalid Mutex directory in argument file:/run/apache2
--- /etc/apache2/conf/httpd.conf.work.xxxxxxx ---
146</IfModule>
147
148# This can be configured in the cPanel 'Leech Protection' interface.
149<IfModule rewrite_module>
150 RewriteEngine on
151 RewriteMap LeechProtect prg:/usr/local/cpanel/bin/leechprotect
152 ===> Mutex file:/run/apache2 rewrite-map <===
153</IfModule>
154
155<IfModule mime_module>
156 TypesConfig conf/mime.types
157
158 AddType application/x-compress .Z
--- /etc/apache2/conf/httpd.conf.work.xxxxxxx ---
Description
This issue occur if the directory specified, /run/apache2
, does not exist on the affected server.
Workaround
Create the directory if it does not exist.
mkdir /run/apache2
chgrp nobody /run/apache2/
chmod 710 /run/apache2/
Afterward, ensure that the Apache configuration can be rebuilt successfully:
# /usr/local/cpanel/scripts/rebuildhttpdconf
Built /etc/apache2/conf/httpd.conf OK