mod_fcgid: can’t apply process slot

It turns out that FastCGI (and I think both for mod_fastcgi and mod_fcgid) doesn’t play well with many of the default Linux setups. fcgid sets up a directory in /var/log/httpd/fcgidsock (mod_fastcgi may be a slightly different directory). The problem is not that the permissions are wrong, but that the permissions of the parent directory are wrong. More to the point, the permissions of the parent directory are made for standard Linux security purposes, not for the purposes of running FastCGI.

The fix is simple. In my case it was a simple chmod 755 /var/log/httpd, which allows Apache to actually read its log directory! Before the change, I was getting “Service Unavailable” with a log error of [warn] mod_fcgid: can’t apply process slot for [dispatch.fcgi full path]. Now it works!