Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can't figure out, how to configure mod_proxy for this.

I have two domains, one is working fine at the moment. Second is bind to the same ip.

I need to forward requests from second domain to another server in local network.

like that: => =>

What configuration or directives i should use?

Thanks ;)


<VirtualHost *:80>
        DocumentRoot "/opt/lampp/htdocs/domain1/public"
        <Directory />
        ScriptAlias /cgi-bin/ "/opt/lampp/cgi-bin/"
        CustomLog  /opt/lampp/logs/custom_apache.log common
        ErrorLog /opt/lampp/logs/error_apache.log
<VirtualHost *:80>
 ProxyRequests Off
 ProxyPreserveHost On
 <Proxy *>
  Order deny,allow
  Allow from all
 ProxyPass /
 ProxyPassReverse /

It just doesn't redirect to second server. That's it. And when i restart apache, it says something with overlapping 80 port.

[warn] _default_ VirtualHost overlap on port 80, the first has precedence

I guess something should be changed next to VirtualHost, in place of *(all), should be domain name?

share|improve this question
up vote 1 down vote accepted

probably this thread has a answer of your query

share|improve this answer
hmm didn't worked for me :\ – Somebody Dec 26 '10 at 12:06
In what way didn't it work? What did you do, what happened exactly? Were there error messages in the browser or in the logs? – RedGrittyBrick Dec 26 '10 at 12:12
i think you need two virtual host entry, one for domain1 and one for domain 2 – pragnesh Dec 26 '10 at 12:34
also configuration file has virualhost defined somewhere else, that's why you are getting warning – pragnesh Dec 26 '10 at 12:37
Sorry were a bit busy. I have updated post. – Somebody Dec 26 '10 at 14:27

You need to uncomment or specify the NameVirtualHost *:80 config verb before your virtualhosts declarations, otherwise it will only ever use one container.

share|improve this answer

Your Answer


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.