(13) Permission denied on Apache CGI attempt
Solution 1:
may or may not work, seems highly unlikely, but someone had a similar problem, and this was the solution;
chmod 755 /var/log/httpd/
or whatever the directory for apache's logs is, on your server.
http://www.mail-archive.com/[email protected]/msg00585.html
Solution 2:
Whilst this is an older question, I thought I would add my answer, as I have had little success finding a proper explanation or solution on the Internet.
I have had this issue occur on RHEL 7 with Apache 2.4 (installed as the httpd24 package) only when using the event MPM (the prefork MPM worked fine). SELinux was already set to permissive.
Based on the comment about the CGI sockets, I checked the documentation:
- mod_cgid#scriptsock
- Default Runtime Directory
Essentially the CGI daemon when using mpm-event requires a socket file. As Apache runs under user apache and group apache on my server (and no doubt many others), the folder containing this socket file must have read-write access by apache.apache.
Not wanting to override the log folder permissions, I chose to explicitly set the ScriptSock
directive in conf.modules.d/00-mpm.conf
:
ScriptSock /var/run/httpd/cgid.sock
I then ensured that the httpd
directory existed (note: you need to configure this via tmpfiles.d
, as /var/run
is a tmpfs) and changed the ownership to apache.apache. Permissions were left as the default 755.
This resolved the issue for me.