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 am running a web server and now I want to be able to use another device that also requires port 80, but I only have a single IP. My web server is Ubuntu and uses Apache. Is there a trick to reroute requests to a certain internal IP based on a domain name? How would I do that?

share|improve this question
    
Are you wanting to run two web servers or run two websites on the same web server? –  Jakobud Nov 10 '11 at 17:59
    
Two "servers". I have one of those NAS devices that require port 80 to be forwarded to it. I am already running multiple web sites. –  Mike Wills Nov 10 '11 at 18:02

2 Answers 2

You'll need to use mod_proxy as a reverse proxy for this.

share|improve this answer
  • create apache namevirtualhosts and forward one virtualhost traffic to the internal IP address with mod_proxy (ProxyPass or RewriteRule [P] )

or

  • use iptables DNAT to forward all requests coming to port 81 towards internal IP port 80.
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.