fcgi fun

Posted by Graham Stratton Mon, 23 Jan 2006 10:56:00 GMT

I’ve been trying to set up Rails with fcgi using mod_fcgid and apache2 on my debian-based system.

I had a load of errors that looked like this in my Apache error log

[error] (13)Permission denied: mod_fcgid: couldn't bind unix domain socket /etc/apache2/logs/fcgidsock/1534.5
[warn] (13)Permission denied: mod_fcgid: spawn process /home/graham/public_html/blog/dispatch.fcgi error

I solved this with

sudo chmod 555 /etc/apache2/logs/

The apache log then said

[notice] mod_fcgid: server /home/graham/public_html/blog/dispatch.fcgi(1814) started
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in `require__': no such file to load -- fcgi (MissingSourceFile)
So, I need to install ruby-fcgi. There is no debian package, but just do
sudo gem install fcgi
assuming ruby gems is installed.

Comments about

`require': no such file to load -- mkmf (LoadError)
mean that you didn’t install ruby-dev.

Death during
checking for fcgiapp.h... no
means libfcgi isn’t installed:
sudo apt-get install libfcgi
sudo apt-get install libfcgi-dev
sudo apt-get install libfcgi-ruby
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in `require__': no such file to load -- rdoc/rdoc (LoadError)
means that I never got round to installing rdoc:
sudo apt-get install rdoc

Now everything installs! However, there’s still an error at runtime about not being able to write to fcgi.crash.log So I set the log in dispatch.fcgi to something writeable, but it doesn’t put anything useful there. Apache just returns a server error and there are segfaults in the apache log.

The remaining problem was presumably that the application couldn’t connect to the database (not sure that should result in a segfault), since starting it in production mode worked!!

Posted in  | no comments

Comments

(leave url/email »)

   Comment Markup Help Preview comment