Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have three servers. Server A is a Apache Server, Server B and C are Tomcat Servers.

I added two new Virtual Hosts to the Apache

1st Host:

<VirtualHost *:80>
    ServerName dev.domain.com
    ErrorLog "/var/log/apache2/dev-server-error.log"
    CustomLog "/var/log/apache2/dev-server-access.log" combined
    SetEnvIf X-FORWARDED-PROTO https HTTPS=on

    ProxyRequests Off
    ProxyPreserveHost On

    <Proxy *>
            Order deny,allow
            Allow from all
    </Proxy>

    ProxyPass / http://servera.com:8080/
    ProxyPassReverse / http://servera.com:8080/

</VirtualHost>

2nd Host:

<VirtualHost *:80>
    ServerName test.domain.com
    ErrorLog "/var/log/apache2/test-server-error.log"
    CustomLog "/var/log/apache2/test-server-access.log" combined
    SetEnvIf X-FORWARDED-PROTO https HTTPS=on

    ProxyRequests Off
    ProxyPreserveHost On

    <Proxy *>
            Order deny,allow
            Allow from all
    </Proxy>

    ProxyPass / http://serverb.com:8080/
    ProxyPassReverse / http://serverb.com:8080/

</VirtualHost>

The first Host is working fine, but when I try to access the second host, I'm accessing the first one (I can see it by viewing the access log of the first host and accesing the second one)

What am I doing wrong???

share|improve this question
    
I doubt your virtual host configuration setting. IIRC, you need to have ip address in place of * in virtual host tag. Otherwise there will be only one running. Please confirm it with netstat command to see if two ip address are bound. –  Naai Sekar Mar 1 '13 at 12:53
    
    
But the server only has one IP... and I have a lot of other vhosts running directly on this server with the <VirtualHost *:80> Tag which are working.... –  Alexander Kiefer Mar 1 '13 at 13:21
    
verify that all DNS records in question point to the correct hosts. check on the servers and on the clients. don't forget to check /etc/hosts –  fuero Mar 1 '13 at 13:44
    
all DNS Records Show to Server A (Server A is the Apache) thats correct, because the apache should hide the other two servers (B and C) where the tomcats are running –  Alexander Kiefer Mar 1 '13 at 14:05
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.