views:

45

answers:

0

Hi,

I have just setup apache and passenger on a new VPS. It is the first time i've deployed a rails app. I've got it all working, it's just that when i refer to one of the routes defined in routes.rb using "www.hostname.com.au/controller/action" it just boots me to the index page of my rails app.

If i use "ip.ip.ip.ip/controller/action" it works fine. I have also noted that any link_to tags (i.e. links) on my rails pages also link via the IP address to initiate actions.

Here is the bottom of my /etc/apache2/apache2.conf file:

ServerName hostname1

ServerTokens Prod
ServerSignature Off

NameVirtualHost *:80

<IfModule mod_ssl.c>
  NameVirtualHost *:443
</IfModule>

LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-2.2.15/ext/apache2/mod_passenger.so
PassengerRoot /var/lib/gems/1.8/gems/passenger-2.2.15
PassengerRuby /usr/bin/ruby1.8
PassengerLogLevel 2

Here is my /etc/apache2/sites-available(enabled)/hostname.com.au file:

<VirtualHost ip.ip.ip.ip:80>
#Config file for hostname.com.au

# domain: hostname.com.au
# public: /srv/hostname.com.au

# Admin email, Server Name (domain name) and any aliases
ServerAdmin [email protected]
ServerName hostname.com.au
ServerAlias www.hostname.com.au

# Index file and Document Root (where the public files are located)
DirectoryIndex index.html
DocumentRoot /srv/hostname.com.au/public
<Directory /srv/hostname.com.au/public>
    Allow from all
    Options -MultiViews
</Directory>

# Custom log file locations
LogLevel warn
ErrorLog /srv/hostname.com.au/logs/error.log
CustomLog /srv/hostname.com.au/logs/access.log combined
</VirtualHost>

Anything seem odd?

Also note, i had to specify ip.ip.ip.ip:80 for virtualhost as without it (i.e. with *:80) i was always directed to the default apache folder in /var/www.

Thanks!