0

I'm trying to do a similar setup to the one discussed in this older thread. I've enabled the proxy_module, proxy_connect_module, proxy_http_module, and rewrite_module. It worked, but now when I go to domain.com it takes me to the ipcamera. I tried adding another virtual host with ServerName domain.com pointing to localhost, but that just makes the page hang.

<VirtualHost *:80>
    ServerName ipcam.domain.com

    ProxyRequests Off
        <Proxy *>
            Order deny,allow
            Allow from all
    </Proxy>
    ProxyErrorOverride On                       
    ProxyPass / http://192.168.1.123/
    ProxyPassReverse / http://192.168.1.123/
    <Location />
    Order allow,deny
        Allow from all
    </Location>

</VirtualHost>

<VirtualHost *:80>
    ServerName domain.com

    ProxyRequests Off
        <Proxy *>
            Order deny,allow
            Allow from all
    </Proxy>
    ProxyErrorOverride On                       
    ProxyPass / http://localhost/
    ProxyPassReverse / http://localhost/
    <Location />
    Order allow,deny
        Allow from all
    </Location>

</VirtualHost>
Elliott
  • 3
  • 1
  • 2
  • Do you have NamevirtualHost *:80 somewhere in your config? Secondly: Proxying to Localhost is pointless, as that means proxying to itself. I would suggest you revert to your previously working config for domain.com and put that first in your config, and ipcamera.domain.com second. – Krist van Besien May 10 '13 at 05:05
  • And give us the output of httpd -S as well... That is more or less mandatory when trying to debug virtual host problems. – Krist van Besien May 10 '13 at 05:06

1 Answers1

1

domain.com should be hosted on the same server ?
You are proxying to the same server (localhost being localhost), so you get an infinite loop?
Remove from second virtualhost the proxy stuff , and configure DocumentRoot etc .

Sandor Marton
  • 1,564
  • 9
  • 12
  • After fiddling around with it some more I was able to get it working doing exactly that. Thanks for the help. NameVirtualHost *:80 ServerName domain.com DocumentRoot "www/mainserver" Servername ipcam.domain.com ProxyRequests Off Order deny,allow Allow from all ProxyPass / http://192.168.1.123/ ProxyPassReverse / http://192.168.1.123/ Order allow,deny Allow from all – Elliott May 12 '13 at 17:50