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 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!

share|improve this question
    
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 3 '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 :) –  TomShreds Nov 3 '10 at 14:29

1 Answer 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.

share|improve this answer
    
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 :) –  TomShreds Nov 4 '10 at 12:56
    
Yes, it will direct everybody to foo.example.com, not just you. –  Mark Wagner Nov 4 '10 at 18:59

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.