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'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>
share|improve this question
    
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 5: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 5:06

1 Answer 1

up vote 1 down vote accepted

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 .

share|improve this answer
    
After fiddling around with it some more I was able to get it working doing exactly that. Thanks for the help. NameVirtualHost *:80 <VirtualHost *:80> ServerName domain.com DocumentRoot "www/mainserver" </VirtualHost> <VirtualHost *:80> Servername ipcam.domain.com ProxyRequests Off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass / 192.168.1.123 ProxyPassReverse / 192.168.1.123 <Location /> Order allow,deny Allow from all </Location> </VirtualHost> –  Elliott May 12 '13 at 17:50

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.