Hey John

I have a similar setup SliceHost, ubuntu, and what not.

And I remember having the same problem when trying to host two
applications.

Looking over your set up and comparing it to mine. Your vhost conf
files are different than mine.

My httpd-vhost.conf file is located in usr/local/apache2/conf/extra
and is as follows.

NameVirtualHost *:80

<VirtualHost *:80>
    ServerName www.mydomain.com
                ServerAlias mydomain.com
          DocumentRoot /var/www/apps/myapp1/current/public

          <Directory /var/www/apps/myapp1/current/public>
            Options FollowSymLinks
            AllowOverride All
            Order allow,deny
            Allow from all
          </Directory>

          # Configure mongrel_cluster
          <Proxy balancer://scoop_cluster>
            BalancerMember http://127.0.0.1:9000
            BalancerMember http://127.0.0.1:9001
          </Proxy>

          RewriteEngine On

          # Prevent access to .svn directories
          RewriteRule ^(.*/)?\.svn/ - [F,L]
          ErrorDocument 403 "Access Forbidden"

          # Check for maintenance file and redirect all requests
          RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
          RewriteCond %{SCRIPT_FILENAME} !maintenance.html
          RewriteRule ^.*$ /system/maintenance.html [L]

          # Rewrite index to check for static
          RewriteRule ^/$ /index.html [QSA]

          # Rewrite to check for Rails cached page
          RewriteRule ^([^.]+)$ $1.html [QSA]

          # Redirect all non-static requests to cluster
          RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
          RewriteRule ^/(.*)$ balancer://scoop_cluster%{REQUEST_URI}
[P,QSA,L]

          # Deflate
          AddOutputFilterByType DEFLATE text/html text/plain text/xml
          BrowserMatch ^Mozilla/4 gzip-only-text/html
          BrowserMatch ^Mozilla/4\.0[678] no-gzip
          BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
                ErrorLog logs/ip.address-error_log
          CustomLog logs/ip.address-access_log combined
</VirtualHost>

<VirtualHost *:80>
    ServerName www.mydomain2.com
                ServerAlias mydomain2.com
          DocumentRoot /var/www/apps/secondapp/current/public

          <Directory /var/www/apps/secondapp/current/public>
            Options FollowSymLinks
            AllowOverride All
            Order allow,deny
            Allow from all
          </Directory>

          # Configure mongrel_cluster
          <Proxy balancer://firstapp_cluster>
            BalancerMember http://127.0.0.1:8000
            BalancerMember http://127.0.0.1:8001
          </Proxy>

          RewriteEngine On

          # Prevent access to .svn directories
          RewriteRule ^(.*/)?\.svn/ - [F,L]
          ErrorDocument 403 "Access Forbidden"

          # Check for maintenance file and redirect all requests
          RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
          RewriteCond %{SCRIPT_FILENAME} !maintenance.html
          RewriteRule ^.*$ /system/maintenance.html [L]

          # Rewrite index to check for static
          RewriteRule ^/$ /index.html [QSA]

          # Rewrite to check for Rails cached page
          RewriteRule ^([^.]+)$ $1.html [QSA]

          # Redirect all non-static requests to cluster
          RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
          RewriteRule ^/(.*)$ balancer://firstapp_cluster%{REQUEST_URI}
[P,QSA,L]

          # Deflate
          AddOutputFilterByType DEFLATE text/html text/plain text/xml
          BrowserMatch ^Mozilla/4 gzip-only-text/html
          BrowserMatch ^Mozilla/4\.0[678] no-gzip
          BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
                ErrorLog logs/ipaddress-error_log
          CustomLog logs/ipaddress-access_log combined
</VirtualHost>

I don't know if that helps.  I am pretty rough at the whole deployment
process.  But I do know that this setup is working for me at the
moment on Slicehost.  So it might be worth a try.

kirk out


On Aug 17, 4:20 am, John Griffiths <[EMAIL PROTECTED]>
wrote:
> 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
>   ServerAliaswww.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
>   </Directory>
>   # Configure mongrel_cluster
>   <Proxy balancer://first_cluster>
>     BalancerMemberhttp://127.0.0.1:8000
>     BalancerMemberhttp://127.0.0.1:8001
>   </Proxy>
>
> and....
>
> /usr/local/apache2/conf/apps/secondapp.conf
>
> <VirtualHost *:8080>
>   ServerName secondapp.com
>   ServerAliaswww.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
>   </Directory>
>   # Configure mongrel_cluster
>   <Proxy balancer://second_cluster>
>     BalancerMemberhttp://127.0.0.1:9000
>     BalancerMemberhttp://127.0.0.1:9001
>   </Proxy>
>
> ....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> firstappwww.second.com> firstapp
>
> any ideas what i've missed in my settings?
>
> really totally dumbfounded & desperate for help,
>
> (will buy beer for answers?)
> --
> Posted viahttp://www.ruby-forum.com/.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Deploying Rails" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-deployment?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to