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.

I'm using mod_proxy to redirect requests of several sub domains of main one to corresponded servers running on the LAN. Long story short here is my config:

ProxyRequests off
<VirtualHost 0.0.0.0:80>
    ServerName sub1.dev.enterprise.com
    ProxyPass / http://localhost:8888/
    ProxyPassReverse / http://localhost:8888/
</VirtualHost>

<VirtualHost 0.0.0.0:80>
    ServerName sub1.dev.enterprise.com
    ProxyPass / http://sub1.dev.enterprise.com:8080/
    ProxyPassReverse / http://sub1.dev.enterprise.com:8080/
</VirtualHost>

After Apache restart any request for .dev.enterprise.com/ ends up on http://localhost:8888/ Why so?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You have the same ServerName in both config sections.

Try running "apache2ctl -t" (debian syntax, but other distributions should have a similar command) to test your config. Apache will also tell you about such obvious mistakes in its logfile.

Btw.: Do not forget to set NameVirtualHost when using VirtualHost.

share|improve this answer

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.