How to serve Rails application with Passenger/Apache without domain name?

Posted by grifaton on Server Fault See other posts from Server Fault or by grifaton
Published on 2010-01-17T18:10:14Z Indexed on 2010/03/30 10:03 UTC
Read the original article Hit count: 402

Filed under:
|

I am trying to serve a Rails application using Passenger and Apache on a Ubuntu server.

The Passenger installation instructions say I should add the following to my Apache configuration file - I assume this is /etc/apache2/httpd.conf.

<VirtualHost *:80>
   ServerName www.yourhost.com
   DocumentRoot /somewhere/public    # <-- be sure to point to 'public'!
   <Directory /somewhere/public>
      AllowOverride all              # <-- relax Apache security settings
      Options -MultiViews            # <-- MultiViews must be turned off
   </Directory>
</VirtualHost>

However, I do not yet have a domain pointing at my server, so I'm not sure what I should put for the ServerName parameter. I have tried the IP address, but when I do that, restarting Apache gives

apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Sun Jan 17 12:49:26 2010] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Sun Jan 17 12:49:36 2010] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results

and pointing the browser at the IP address gives a 500 Internal Server Error.

The closest I have got to something sensible is with

<VirtualHost efate:80>
   ServerName efate 
   DocumentRoot /root/jpf/public
   <Directory /root/jpf/public>
      AllowOverride all
      Options -MultiViews
   </Directory>
</VirtualHost>

where "efate" is my server's host name. But now pointing my browser at the server's IP address just gives a page saying "It works!" - presumably this is a default page, but I'm not sure where this is being served from.

I might be wrong in thinking that the reason I have been unable to get this to work is related to not having a domain name. This is the first time I have used Apache directly - any help would be most gratefully received!

© Server Fault or respective owner

Related posts about passenger

Related posts about apache