Unable to access Rails app on Apache + Passenger

0 votes
asked Nov 20, 2013 by thedude

I am trying to setup a basic Rails app with Apache and Passenger on Ubuntu. I am able to start WEBrick on the server, but not through Apache.

Here is my app's conf file:

<VirtualHost *:80>
  ServerName blog.dev
  DocumentRoot /var/blog/current/public
  CustomLog /var/log/apache2/blog-access_log combined
  ErrorLog /var/log/apache2/blog-error_log
   <Directory /var/blog/current/public>
         # This relaxes Apache security settings.
         AllowOverride all
         # MultiViews must be turned off.
         Options -MultiViews

And here is the passenger conf:

LoadModule passenger_module /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.24/buildout/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.24
PassengerRuby /usr/local/bin/ruby
PassengerMaxPoolSize 5
PassengerPoolIdleTime 90
PassengerMaxRequests 10000

I do have Apache and passenger installed correctly (as well as the Apache module for Passenger). When I do curl localhost, the generic Apache page is shown and not my app. I haven't seen anything in the Apache error logs that would indicate a failure. Is there something I am missing to get this to work?

EDIT: I am able to hit blog.dev using curl, but it returns the default Apache page and not the Rails default page. Here is the entry in the hosts file:   blog.dev

Also, when I run sudo passenger-stats, I don't see my application in the Application groups. I am guessing that Passenger is the problem here, but I can't seem to find out what is going on.

1 Answer

+1 vote
answered Nov 20, 2013 by sevenseacat

You've set ServerName in your config to be blog - that means it will respond to requests for the domain blog. You should set this to the domain you actually want to use to serve the blog on.

Welcome to Q&A, where you can ask questions and receive answers from other members of the community.
Website Online Counter