Trying to Setup a Rails Application using Plesk and Mongrel Clusters

Discussion in 'Apache' started by zbo09, Jan 15, 2009.

  1. #1
    I have two IP addresses both pointing to the same server.

    (for sake of the question)

    1st IP: 1.2.3.4
    2nd IP: 2.3.4.5

    My problem is when I have set the Rails app on 1.2.3.4 and browse to it all is fine however when I set up a completely different app (CakePHP) on 2.3.4.5 I suddenly find myself looking at my Rails app!?!

    Here is the conf file for the rails app:

    
    [B]<VirtualHost 1.2.3.4:80>[/B]
    
            ServerName www.extranet.ideageneration.co.uk
    	
    	Alias /extranet /var/www/vhosts/ideageneration.co.uk/subdomains/extranet/httpdocs/current/public
    
    	ProxyPass /extranet http://localhost:8000/extranet
    	ProxyPassReverse /extranet http://localhost:8000/extranet
     	ProxyPreserveHost on
    
            DocumentRoot /var/www/vhosts/ideageneration.co.uk/subdomains/extranet/httpdocs/current/public
    	
    	<Directory "/var/www/vhosts/ideageneration.co.uk/subdomains/extranet/httpdocs/current/public">
                    Options FollowSymLinks
                    AllowOverride None
                    Order allow,deny
                    Allow from all
            </Directory>
    	
    	<Location /ig-extranet>
    
    	</Location>
    
            RewriteEngine On
    
            # 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://mongrel_cluster%{REQUEST_URI} [P,QSA,L]
    
            ErrorLog logs/idea_generation_errors.log
            CustomLog logs/idea_generation.log combined
    	
    </VirtualHost>
    
    <Proxy balancer://mongrel_cluster>
            BalancerMember http://127.0.0.1:8000
            BalancerMember http://127.0.0.1:8001
            BalancerMember http://127.0.0.1:8002
            BalancerMember http://127.0.0.1:8003
            BalancerMember http://127.0.0.1:8004
            BalancerMember http://127.0.0.1:8005
    </Proxy>
    
    Code (markup):
    Can anyone help by explaining what I must do in order to have multiple IP on the same machine point to different apps.

    I apologise if I may not be making sense. I am a bit fo a noob when it comes to server admin.

    Thanks.

    D
     
    zbo09, Jan 15, 2009 IP
  2. StevePro

    StevePro Peon

    Messages:
    106
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi,

    What are the VHOST settings for your CakePHP app?
     
    StevePro, Feb 20, 2009 IP