0

I know that can be done with the hosts file and that it should be done with it but for some reason I'd really have to make Apache act this way.

The problem is: the hosts are already in the DNS which I can't modify at all but they lead to my network's web server.

I'd like to receive requests from that IP, and simply shoot them to another IP. Is there any way of doing so with Apache2?

Thanks a lot!

Tommy B.
  • 1,403
  • 2
  • 14
  • 14
  • Your question is not well defined. Are you saying that there are DNS records out on the Internet which are not yours but which point to an IP address of yours? – ThatGraemeGuy Nov 03 '10 at 14:12
  • Not on the internet, the DNS server is in the same office but I don't have the rights to modify it. Thanks :) – Tommy B. Nov 03 '10 at 14:29

1 Answers1

1

Sounds like you are looking for a reverse proxy. In the vhost config add:

 ProxyPass / http://foo.example.com/
 ProxyPassReverse / http://foo.example.com/

foo.example.com is where you want to "shoot" the requests.

Mark Wagner
  • 17,764
  • 2
  • 30
  • 47
  • Thanks! I did not knew about that. It isn't currently enabled on my server so I was wondering, do you think it'll mess something if I activate it? We are a lot of people working on the same server and I don't want to mess it all up :S Thanks again :) – Tommy B. Nov 04 '10 at 12:56
  • Yes, it will direct everybody to foo.example.com, not just you. – Mark Wagner Nov 04 '10 at 18:59