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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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@xxxxxxxxxx            http://www.temme.net/sander/
PGP FP: 51B4 8727 466A 0BC3 69F4  B7B8 B2BE BC40 1529 24AF


Attachment: smime.p7s
Description: S/MIME cryptographic signature


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux