I am trying to host multiple versions (dev and staging) of a Rails app on the same server, but I am not currently able to access both via the browser.
I am running with Apache2, Passenger, Rails 3, and Ubuntu 10.04 LTS.
I would like to access the 2 sites via the same IP but with different ports. Is this allowed? When I access the staging environment via "http://220.127.116.11", it works just fine, but when I try to access the dev environment via "http://18.104.22.168:8080", the browser says it cannot connect to "http://22.214.171.124:8080".
In theory, should this work? Do I need to assign actual domains (e.g. "http://example.com" and "http://dev.example.com")?
# ports.conf Listen 80 NameVirtualHost *:80 Listen 8080 NameVirtualHost *:8080 # sites-enabled/staging-example.com <VirtualHost *:80> ServerName example.com DocumentRoot "/home/www/example/staging/current/public" <Directory "/home/www/example/staging/current/public"> Allow from all Options -MultiViews </Directory> </VirtualHost> # sites-enabled/dev-example.com <VirtualHost *:8080> ServerName dev-example.com DocumentRoot "/home/www/example/dev/current/public" <Directory "/home/www/example/dev/current/public"> Allow from all Options -MultiViews RailsEnv development </Directory> </VirtualHost>
Note: I also created the config/setup_load_paths.rb as recommended by http://dalibornasevic.com/posts/21-rvm-and-passenger-setup-for-rails-2-and-rails-3-apps.