hi, i’m using SliceHost as my hoster and running Ubuntu 6.10 on it, but
got a problem when i’m trying to get more than one rails app running on
my box.
basically i’ve used capistrano + deprec to deploy the first one, works
fine and no problems there, deployed the second one and that looks ok
via capistrano,
however got confused with the settings in my apache httpd.conf file and
the two app.conf files, hope you can help?
first off i followed the guide,
http://wiki.slicehost.com/doku.php?id=multiple_rails_apps_on_one_slice
to get the second rails app on the box, used…
cap deprec_setup
cap deploy_with_migrations
that went fine and managed to get subversion working for the source
repositories, good.
now onto the setting files,
in the first apps, deploy.rb
set :apache_proxy_port, 8000
second app has,
set :apache_proxy_port, 9000
so both are using different port addresses,
now onto the mongrel cluster settings,
/etc/mongrel_cluster/firstapp.yml
cwd: /var/www/apps/first/current
port: “8000”
environment: production
address: 127.0.0.1
pid_file: log/mongrel.pid
servers: 2
/etc/mongrel_cluster/secondapp.yml
cwd: /var/www/apps/second/current
port: “9000”
environment: production
address: 127.0.0.1
pid_file: log/mongrel.pid
servers: 2
now in the apache app configs,
/usr/local/apache2/conf/apps/firstapp.conf
<VirtualHost *:80>
ServerName firstapp.com
ServerAlias www.firstapp.com
DocumentRoot /var/www/apps/first/current/public
<Directory /var/www/apps/first/current/public>
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
Configure mongrel_cluster
<Proxy balancer://first_cluster>
BalancerMember http://127.0.0.1:8000
BalancerMember http://127.0.0.1:8001
and…
/usr/local/apache2/conf/apps/secondapp.conf
<VirtualHost *:8080>
ServerName secondapp.com
ServerAlias www.secondapp.com
DocumentRoot /var/www/apps/second/current/public
<Directory /var/www/apps/second/current/public>
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
Configure mongrel_cluster
<Proxy balancer://second_cluster>
BalancerMember http://127.0.0.1:9000
BalancerMember http://127.0.0.1:9001
…in my /usr/local/apache2/conf/httpd.conf
i’ve stated the servername [ip address]
ServerName 208.75.85.16
…but not the port :8080 and :80 at the end, should I ?
plus these extra bits at the end,
Listen 80
Listen 8080
Include conf/apps/
NameVirtualHost *:80
NameVirtualHost *:8080
the dns has an A record relating the first.com > 208.75.85.16
and the second to second.com > 208.75.85.16
however after rebooting both the mongrel clusters with
/first/cap restart_mongrel_cluster
/second/cap restart_mongrel_cluster
/second/cap restart_apache
…the domain name for the second app is still pointing to the first
app,
e.g.
www.first.com > firstapp
www.second.com > firstapp
any ideas what i’ve missed in my settings?
really totally dumbfounded & desperate for help,
(will buy beer for answers?)