Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

I saw other questions about this that were similar, but not exact.

So, my issue is, I have a home server that hosts my website and uses my outside ip. Well, rather my domain name directs to that ip. I have a second computer that I would like to run a webserver on as well. The only way I could think of to do this was to use a different port and still access my domain. Do, would take me to my main site, but would take my to my second computer that his hosting a site.

Does this make sense? It is this possible since these are different computers and I really only have 1 ip.

I think I could make a subdomain like but not sure if this would help.


share|improve this question
If you really want to get fancy you could use a reverse-proxy to answer connections coming from the Internet and host an arbitrary number of web sites internally on an arbitrary number of computers. – Evan Anderson Oct 29 '09 at 6:33
up vote 2 down vote accepted

yes, you can run a separate website on a different port. But as far as having a subdoamin, it wont really matter because a domain can only point to an ip address, not an ip address + port. By default web sites use port 80: is the same as

so if you have a subdomain and you run a website on a different port, you're gona have to specifiy the port with it, i.e.

share|improve this answer

There are a couple options here depending on exactly what you want to do. Both machines can't answer on the same IP and same port, so the easiest solution is to run it on another port.

I would instead use the primary machine as the DNS entry and then gate traffic from there. So you could set up your webserver to proxy or redirect the other domain, or even subfolder to the other machine.

So would go to machine1. would still go to machine1, but would then be redirected or proxied to machine2. Redirecting is easy to setup, but the URL would still have the alternate port in it. Proxy is the most transparent, because everything is still directly talking to machine1. It may respond a little slower though, because all the communication is going through both webservers before it gets to the end client.

share|improve this answer

You could also specify virtual hosts in your port 80 server so that a certain domain ( would redirect to

Put this at the end of your httpd.conf file (assuming Apache with mod_rewrite):

NameVirtualHost *:80

<VirtualHost *>
  DocumentRoot "C:/Web/Docs/"

<VirtualHost *>
  DocumentRoot "C:/Web/Docs/FileWithPHPRedirect/JustInCase"
  RewriteEngine On
  RewriteCond %{SERVER_PORT} !8080$
  RewriteRule ^(.*)$1 [R=301,L] 

Have your firewall forward port 8080 to the second server. The paths here are Windows paths, just change them if need be.

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.