A couple of months ago I set up a rails app using apache, passenger and virtualhost and I (eventually) got everything working fine. Now I am trying host another application on the same box. I've added the new virtual host (see below - app2), and edit my hosts file to point at the hosting IP (192.x.x.10), however when I enter app2.host.com I get app1. Also when I browse to http://192.x.x.10 I get app1 automatically. Is this normal?
My httpd.conf file looks like this:
LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-3.0.9/ext/apache2/mod_passenger.so
PassengerRoot /var/lib/gems/1.8/gems/passenger-3.0.9
PassengerRuby /usr/bin/ruby1.8
<VirtualHost *:80>
ServerName app1.host.com
DocumentRoot /var/www/app1/public
<Directory /var/www/app1/public>
AllowOverride all
Options -MultiViews
</Directory>
ErrorLog /var/log/apache2/error.log
</VirtualHost>
<VirtualHost *:80>
ServerName app2.host.com
DocumentRoot /var/www/app2/public
<Directory /var/www/app2/public>
AllowOverride all
Options -MultiViews
</Directory>
ErrorLog /var/log/apache2/error.log
</VirtualHost>
I've done a lot of research into this and everything I've seen seems to indicate that I am missing a NameVirtualHost *:80
But I have included this in my ports.conf file.
I really hope someone can help me out. I'm on a Ubuntu server.
Thanks in advance for any help you can offer.