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

2 Servers: Server 1 on 1 public IP, Server 2 on Local LAN.

I have this working with a proxy on Server1 right now. But I need to add one localhost on Server2 which is NOT a recognized domain. So I am adding it via proxy. Seems having difficulty here. let me know.

I added the localhost on server1 and server2's vhost files but it does not work.

It is currently setup like this on Server 1 with a Proxy setup and working and this is what in its httpd_vhosts.conf.

ProxyRequests Off
ProxyPreserveHost On

NameVirtualHost *

<VirtualHost *:80>
    ServerName domain1.com
    ServerAlias www.domain1.com
    DocumentRoot "/Library/Server/mydocuments"
    <Directory "/Library/WebServer/mydocuments">
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName domain2.com
    ServerAlias www.domain2.com  
    ProxyPass / http://10.1.10.2:80/
    ProxyPassReverse / http://10.1.10.2:80/
</VirtualHost>

For the new Localhost I am adding this on above's Server1's httpd_vhosts.conf.

<VirtualHost *:80>
    ServerName nynews.domain1.com
    ServerAlias www.nynews.domain1.com
    ProxyPass / http://10.1.10.2:80/
    ProxyPassReverse / http://10.1.10.2:80/
</VirtualHost>

SERVER 2:

This is currently setup like this on Server2's httpd_vhosts.conf

NameVirtualHost *

<VirtualHost *:80>
    ServerName domain2.com
    ServerAlias www.domain2.com
    DocumentRoot "/Library/Server/mydomain2"
    <Directory "/Library/WebServer/mydomain2">
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

For the new Localhost in Server2 I am adding this on server 2's httpd_vhosts.conf

<VirtualHost *:80>
    ServerName nynews.domain1.com
    ServerAlias www.nynews.domain1.com
    DocumentRoot "/Library/Server/domain1"
    <Directory "/Library/WebServer/domain1">
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>
share|improve this question
    
Can you clarify what behavior you're seeing? –  Shane Madden Feb 1 '12 at 20:39
    
Its either I get a blank page or I get the other domain2.com but not the nynews.domain1.com. Not quite sure why. I tried changing the portnumber to 8080 and it just will not work. –  TagaS Feb 2 '12 at 0:59
    
All good now... Edited it and working right. thanks. –  TagaS Feb 3 '12 at 0:02

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.