mod_fcgid and the cfgi gem for rails with apache2 on fedora core 6

Because its not readily apparent when you’re concentrating on learning rails… I’m posting this here. While trying to get rails running on Fedora Core 6 (FC6) I was running into not being able to compile the ruby fcgi gem.

What gives, right? mod_fcgid (what FC6 comes with) is supposed to be binary compatible with mod_fastcgi. And there *IS* no mod_fastcgi or fastcgi in yum! Well it turns out that

mod_fcgid and mod_fastcgi both connect to fastcgi. That bears repeating. mod_fcgid is roughly equivalent to mod_fastcgi but niether are equivalent to fastcgi. (which in retrospect seems obvious as so many things do when you’re searching for answers)

so… on FC6, install mod_fcgid. then download and install fastcgi (not mod_fastcgi) from http://www.fastcgi.com/dist/ and then

gem install fcgi --source \
  http://rubyforge.planetargon.com/gems.rubyforge.org/ \
  -- \
  --with-fcgi-include=/usr/local/include \
  --with-fcgi-lib=/usr/local/lib

will work and everything will be peachy-keen

since a lot of people will be searching about this in a specific scope for Fedora Core 6, and since nobody seems to directly state this issue in plain terms, here it is. Google, eat me up! 😉

4 thoughts on “mod_fcgid and the cfgi gem for rails with apache2 on fedora core 6

  1. Jeff says:

    Thanks for the post. You saved me from searching long and hard for mod_fastcgi for fc6 =). I do have two follow up questions though:

    1. Is it necessary to have the extra arguments after "gem install fcgi"? I can't seem to get it to work with them.

    2. The yum repo has two versions of mod_fcgid. Do you know if they're for different versions of httpd? The reason I ask is because I try running httpd and get the following error:

    Can't locate API module structure `fastcgi_module' in file /usr/lib/httpd/modules/mod_fcgid.so: /usr/lib/httpd/modules/mod_fcgid.so: undefined symbol: fastcgi_module

    Thanks!

  2. In response to your questions

    1. I'm not actually sure on that. I got the command line from a how-to elsewhere. If it compiles fine without the args then I would venture a guess that it found the proper libs, though I wouldn't put money on it 🙂

    2. I see mod_fcgid.i386 and mod_fcgid-selinux.i386. I do not run with selinux, and so I only have the first installed.

    Assuming that you have mod_fcgid, and httpd installed via yum, assuming that you have fcgi compiled and installed from source, assuming that the gem build of fcgi succeeds, and finally ssuming that we're talking about fedora core 6. It should all come together pretty well for you…

  3. Jeff says:

    Wow, quick reply =) All of your assumptions are correct.

    When I run 'yum search fcgi' I find mod_fcgid.i386.1.10-7.fc6 as well as mod_fcgid.i386.2.0-1.fc6, along with the se-linux packages. I'm guessing that different versions of mod_fcgid work with different versions of httpd, although I can't seem to get mod_fcgid 2.0 working with httpd 2.2 or 2.0. I'm starting to suspect my httpd.conf. Anyway, thanks for the help and I'll be sure to share the source of my troubles and a solution once I figure them out.

Leave a Reply to apokalyptikCancel reply