Take the 2-minute tour ×

I just finished working on my first rails app and am ready to deploy to my VPS. I decided to try using Phusion Passenger and went through the extremely simple install process. I got all the right dependencies, so on that end things seems to be ok. Where I think my problem lies is in the routing and the apache config file.

As told I added the following at the very end of the following file: /etc/apache2/apache2.conf

LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-3.0.8/ext/apache2/mod_passenger.so
PassengerRuby /usr/bin/ruby1.8

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot /home/bl/gfy/public
    <Directory /home/bl/gfy/public>
        Allow from all
        Options -MultiViews

When I restart apache I get the following message:

* Restarting web server apache2                                                                                                                                        [Wed Aug 10 03:16:24 2011] [warn] module passenger_module is already loaded, skipping
 ... waiting [Wed Aug 10 03:16:26 2011] [warn] module passenger_module is already loaded, skipping

When I point my browser to my the IP I set up I get pointed to the sample file that comes with apache instead of to my rails app.

Any ideas would be greatly appreciated.


share|improve this question
Have you tried changing the ServerName to not be localhost? Let us know what happens. –  Thiago Jackiw Aug 10 '11 at 8:46
@Thiago Jackiw I have tried to change the server name to the name of my app but that didn't work either. Also not I only have an IP for the server there isn't really a server name for me to specify. –  Bnjmn Aug 10 '11 at 15:07
add comment

1 Answer

up vote 2 down vote accepted

Somewhat unrelated to your problem, but still.

Both warning you see are not critical and should not affect server operations. One means that your server hostname is not set, another just reminds you that passenger is already loaded from somewhere, probably after it stumbles upon in /etc/apache/modules.d.

All in all, you don't really want to edit /etc/apache/apache2.conf. Instead use existing structures, like /etc/apache2/sites-available etc.

Now back to your problem.

Your VirtualHost is most likely being overriden by default host. Executing sudo a2dissite default in your shell will disable it. Assuming you don't have some exotic LAMP flavor.

share|improve this answer
thanks for the tip, now when I refresh it brings me to the public folder of my rails project but it is showing me the folder listing of the contents instead of running it as a rails app. Any further suggestions? –  Bnjmn Aug 10 '11 at 16:16
I assume you've fixed the issue already. If this is the case - could you please share some details. I'm sure other people will find it useful. If it's not the case, you can try enabling passenger logging. You'll have to check both general apache error log and site-specific one. –  Slotos Aug 11 '11 at 9:37
issue not solved yet, working on it later and will post some details as they become clear. –  Bnjmn Aug 11 '11 at 18:18
Check /etc/apache2/modules.d for mod_rails or passenger conf file. Check if PassengerEnabled is set to off there. If that's the case - either enable it globally (you'll need another file with higher preceding number in its name) or just for your virtualhost. I'd recommend going with the latter one, keeping things as small as possible is generally the best practice. –  Slotos Aug 11 '11 at 19:50
Actually instead of checking for a file you can use grep -Ri PassengerEnabled /etc/apache2/. The only downside is that you won't remember particular file names the next day :) –  Slotos Aug 11 '11 at 19:54
show 3 more comments

Your Answer


