0

This is what I am trying to do:

NameVirtualHost *
<VirtualHost *>
        ServerName testsite.org
        ServerAdmin webmaster@testsite.org
        DocumentRoot /var/www/
</VirtualHost>

<VirtualHost *>
        ServerName panel.testsite.org
        ProxyPass / http://panel.testsite.org:10000/
        ProxyPassReverse / http://panel.testsite.org:10000/
</VirtualHost>

<VirtualHost 12.34.56.78>
        ServerName newsite.com
        ServerAdmin webmaster@newsite.com
        DocumentRoot /var/newsite/
</VirtualHost>

<VirtualHost 12.34.56.78>
        ServerName panel.newsite.com
        ProxyPass / http://panel.newsite.com:10000/
        ProxyPassReverse / http://panel.newsite.com:10000/
</VirtualHost>

The problem is that it won't accept the 2nd vhost with the IP 12.34.56.78 because it says one already exists. panel.newsite.com and newsite.com have the same IP...so I am not sure how I can make it so that only the URL "panel.newsite.com" will get proxypassed to port 10000 but no other URL on newsite.com

user36644
  • 3
  • 1

1 Answers1

0

Virtual host doesn't really apply to multiple instances of the same ip addresses. You don't need to use the specific IP, when your "NameVirtualHost" is already *.

Try:

<VirtualHost *>
        ServerName newsite.com
        ServerAdmin webmaster@newsite.com
        DocumentRoot /var/newsite/
</VirtualHost>

<VirtualHost *>
        ServerName panel.newsite.com
        ProxyPass / http://panel.newsite.com:10000/
        ProxyPassReverse / http://panel.newsite.com:10000/
</VirtualHost>

If the virtual host directive isn't unique (or a wildcard), then the config just defaults to the first match, which is why it's not going past the first one, since the IP is overriding the ServerName.

Satanicpuppy
  • 5,946
  • 1
  • 17
  • 18
  • This way works and allows me to access the newsite webmin correctly. However, when I access http://newsite.com:10000 it relocates to http://panel.testsite.org/ – user36644 Mar 03 '10 at 21:35
  • I take that back, it loads the wrong page now... – user36644 Mar 03 '10 at 21:38
  • This did not work for a solution, it wouldnt load any pictures from newsite.com..they would come as a 404 error on testsite.org... – user36644 Mar 03 '10 at 21:46