You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Charles Michener <mi...@yahoo.com> on 2006/09/09 20:00:42 UTC

[users@httpd] Servers listening for different ports question

I have an Apache server listening to port 80 and serving domains 1,2,3,... To reduce the first server's load I would like to install another server running Apache; I would like to set it up looking at the same router and IP address but listening to a different port - say 8080 - serving domains 20, 21, 22,...

I understand that the new server would have an HPPTD.CONF file that says LISTEN 8080 not LISTEN 80.

My question is where do I tell the transferred domains - 20, 21, 22,... that they should come in on 8080 not the default 80.

Charles Michener

 		
---------------------------------
 All-new Yahoo! Mail - Fire up a more powerful email and get things done faster.

Re: [users@httpd] Servers listening for different ports question

Posted by Joshua Slive <jo...@slive.ca>.
On 9/9/06, Charles Michener <mi...@yahoo.com> wrote:
> I have an Apache server listening to port 80 and serving domains 1,2,3,...
> To reduce the first server's load I would like to install another server
> running Apache; I would like to set it up looking at the same router and IP
> address but listening to a different port - say 8080 - serving domains 20,
> 21, 22,...
>
> I understand that the new server would have an HPPTD.CONF file that says
> LISTEN 8080 not LISTEN 80.
>
> My question is where do I tell the transferred domains - 20, 21, 22,... that
> they should come in on 8080 not the default 80.

You can't, unless your router has the ability to do this (unlikely).
The default port for HTTP is 80, and if you want the clients to use a
different port, it needs to be specified explicitly in the URLs as in
http://server.example.com:8080/

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Servers listening for different ports question

Posted by Sander Temme <sc...@apache.org>.
On Sep 9, 2006, at 11:00 AM, Charles Michener wrote:

> I have an Apache server listening to port 80 and serving domains  
> 1,2,3,... To reduce the first server's load I would like to install  
> another server running Apache; I would like to set it up looking at  
> the same router and IP address but listening to a different port -  
> say 8080 - serving domains 20, 21, 22,...
>
> I understand that the new server would have an HPPTD.CONF file that  
> says LISTEN 8080 not LISTEN 80.

If you have only one IP address configured on the box, you'll have to  
put the second server on a different port, yes.

> My question is where do I tell the transferred domains - 20, 21,  
> 22,... that they should come in on 8080 not the default 80.

As Joshua points out, that doesn't work unless you can afford to have  
your users explicitly specify the port number in the URLs they access.

An alternative for you would be to have the second server bind to an  
additional IP address on the box. Like so:

httpd.conf:

Listen 192.168.1.2:80

<VirtualHost *:80>
     ServerName domain1
     ...
</VirtualHost>

<VirtualHost *:80>
     ServerName domain2
     ...
</VirtualHost>

httpd2.conf:

Listen 192.168.1.3:80

<VirtualHost *:80>
     ServerName domain20
     ...
</VirtualHost>

<VirtualHost *:80>
     ServerName domain21
     ...
</VirtualHost>

This would cost you an extra outside IP address, but you'd get to use  
port 80. Of course your DNS would have to be set up so that clients  
hit the right IP addresses for the respective domains. You'd set the  
second IP up as an alias on the network interface (falls outside the  
scope of this list). Added bonus: if you ever decide to move that  
second server to a different box, you won't have to change DNS but  
just move the software configuration over.

S.

-- 
sctemme@apache.org            http://www.temme.net/sander/
PGP FP: 51B4 8727 466A 0BC3 69F4  B7B8 B2BE BC40 1529 24AF