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?

link|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
feedback

2 Answers

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

link|improve this answer
feedback
  • 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.
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.