tags:

views:

25

answers:

2

Lets us consider a case, there are 2 apache server running, and one domain is available. if we make a request like this, http://domain1.com/example1.php it should request one apache server where actual domain is present. When http://domain1:8000/example1.php it should point to a application in a another server (other machine) under a same domain group.

Now a question is, if http://domain1:8000/example1.php is requested, then it will run in which server? which server will interpret it? which server will execute those files, either apache server in domain1 system or, a apache server that domain1:8000 (this is other machine, to which request is port forwarded) points?

+1  A: 

A server will listen on a specific port, so if you are using different ports, it will go to whatever server is listening on that port, regardless of the domain.

webdestroya
A: 

Since you're using port forwarding, then it can only be processed by where ever you forward the ports to. So, port 80 is being forwarded to your main server and port 8000 to the other server. If you didn't forward, and all were going to the first server, then you would get an error if the first server were not also listening on port 8000.

Graham Chiu