Tuesday, March 14, 2006

FastCGI failing on Fedora with Ruby on Rails

After battling with all the FAQ and wikis getting FastCGI to work with Apache, I found the last problem. FastCGI spawns temporary files in your /etc/httpd/log/fastcgi/dynamic directory (unless you override this in your http.conf file).

I was still getting these errors:

[Mon Mar 13 17:03:08 2006] [crit] (13)Permission denied: FastCGI: can't create (dynamic) server "/var/www/html/test.rails/public/dispatch.fcgi": bind() failed [/tmp/fastcgi/dynamic/a452aa13feeda365028a2d43d1b2ce13]

It turned out that my problem was SELinux getting in the way. It really locks down what the apache user can do (which is probably a really good thing). However, for fastcgi it was locked down a little too much. I intend to now fight a little with SELinux to see if I can get it to play nice.

If you want to temporarily disable it, you can run this command:

echo "0" >/selinux/enforce

you can echo a "1" to turn it back on.

1 comment:

ian connor said...

One other point is that if you disable SELinux fedora core 4 will then allow root to login in via ssh - which is not good. So after you disable SELinux, make sure you edit your
/etc/ssh/sshd_config
to set
PermitRootLogin no
and then restart sshd