Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Ruby on Rails, Apache, and Fastcgi
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
YopWongSapn
l33t
l33t


Joined: 26 Jan 2004
Posts: 627

PostPosted: Sat Oct 01, 2005 3:34 am    Post subject: Ruby on Rails, Apache, and Fastcgi Reply with quote

Ok. I've been told of this "super-sweet" "wetdream for web developers" called Ruby on Rails. So, like any other geek, I tried it out. It's awesome from what I can tell. I installed it on my web server, and have been playing around with it for the last few days.

I really love it, except for one issue...it's damn slow through apache2. It takes at least 5 seconds for the pages to load, which obviously is not acceptable for a production website.

I ran the script/server script, which started up WEBrick (or whatever it's called) on port 3000. Rails ran beautifully at this point, so it's obviously an issue specific to apache2.

So, again, as any geek would do, I did some research. I found out that mod_fastcgi is a means of speeding it up; more specifically (as I later found out), there's a ruby-fcgi module. So I installed fastcgi, then ruby-fcgi. I think this may be one of my problems. I followed the tutorial here, as well as the how-to in these forums (although it was of little help).

Now, when I try to access one of the Rails pages, I get an error that says "Application error. Rails application failed to start properly". When I disable the fastcgi module within the apache conf file, it works properly, albiet slow.

Has anyone successfully gotten around this speed issue with apache2? Can anyone point me in the right direction?
_________________
Gentoo...it's like wiping your ass with silk. Or sandpaper.
Back to top
View user's profile Send private message
petz
n00b
n00b


Joined: 25 Sep 2004
Posts: 7

PostPosted: Mon Oct 03, 2005 9:56 am    Post subject: Ruby on Rails, Apache, and Fastcgi Reply with quote

Hi!
I had the same problem after Apache 2 was updated. I reemerged mod_fastcgi.
I also had to copy the /etc/apache2/conf/modules.d/20_mod_fastcgi.conf to /etc/apache2/modules.d/

Then it worked again.
Back to top
View user's profile Send private message
YopWongSapn
l33t
l33t


Joined: 26 Jan 2004
Posts: 627

PostPosted: Mon Oct 03, 2005 4:45 pm    Post subject: Reply with quote

Thanks for the advice. While your solution didn't work for me, it set me on the right track. I upgraded apache, went through the wonderfully tedious process of switching over to the new config file structure (that was a good half hour down the drain).

Once I made sure all my other modules were still working, I moved on to fastcgi. Here's the key. I noticed that the public/dispatch script from my rails installation has the .fcgi extension. The stock /etc/apache2/modules.d/20_mod_fastcgi.conf file has
Code:
        <IfModule mod_fastcgi.c>
                AddHandler fastcgi-script .fcg
        </IfModule>


So, I changed it to
Code:
        <IfModule mod_fastcgi.c>
                AddHandler fastcgi-script .fcgi
        </IfModule>


Voila...it works perfectly...w00t. :lol:
_________________
Gentoo...it's like wiping your ass with silk. Or sandpaper.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum