Operating System - HP-UX
1834078 Members
2421 Online
110063 Solutions
New Discussion

Re: Multiple Web servers one port 80

 
Jim Krol
Advisor

Multiple Web servers one port 80

We are trying to run a service guard cluster of web servers. Each of our iPlanet servers uses port 80. Is there any way to run more than one web server using the same port. I know I can use a different ip address with each web server ie 123.45.67.89:1 etc. My question is, will port 80 follow the secondary ip address or is there one and only one port 80 on a machine. Has anyone done this and can it be done. Any help would be appreciated.

Jim Krol
james.krol@boeing.com
3 REPLIES 3
Steven Sim Kok Leong
Honored Contributor

Re: Multiple Web servers one port 80

Hi,

I believe you are referring to virtual host implementation that is available in most webserver software such as apache and IIS.

With virtual host settings, you can specify in the webserver configuration files the following procedures:

For www.a.com -> 1.2.3.4
DocumentRoot: /htdocs/a/

For www.b.com -> 1.2.3.4
DocumentRoot: /htdocs/b/

In this case,

Accessing the URL http://www.a.com gets you to the page /htdocs/a/index.html.

Accessing the URL http://www.b.com gets you to the page /htdocs/b/index.html.

Hope this helps. Regards.

Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com
janders
Advisor

Re: Multiple Web servers one port 80

Hi,
As far as tcp ports go there is only one port 80. Much like telnet or ftp there is only one port listening on all IP's assigned to a box. netstat -an will show tcp 0 0 *.80 *.* LISTEN or tcp 0 0 *.21 *.* LISTEN or tcp 0 0 *.23 LISTEN until an active socket connection is established then it will change to something similar to tcp 0 0 10.10.10.80.23 10.10.15.5.1803 ESTABLISHED. But I guess thats not to say you couldnt set up another server to answer at a different port in the /etc/services file however then the requesting clients would also have to know which port to query/connect to for the service.

Hope that helps.
Jason
Steven Sim Kok Leong
Honored Contributor

Re: Multiple Web servers one port 80

Hi,

Since you are running a MC/ServiceGuard cluster, you should be using the floating IP address.

MC/ServiceGuard aside, rather than running multiple webservers to serve different functionalities, it would be cleaner and more efficient to use virtual hosting.

Example:

Webserver 1:

www.a.domain.com -> 1.2.3.4 (floating IP)
www.b.domain.com (virtual host) -> 1.2.3.4 (floating IP)

When your primary webserver fails over to your secondary webserver in the cluster, the web service on your secondary webserver is started up with a similar configuration (using the floating IP).

And within the web serviceguarded package, you can configure multiple virtual hosts for your web server configuration (eg. httpd.conf). In this example, there is only one virtual host ie. www.b.domain.com configured.

The result of using ServiceGuard (ie. floating IPs) and virtual host (ie. httpd.conf) is that you can have two websites running on a single web service package that fails over from your primary webserver to your secondary webserver.

Hope this helps. Regards.

Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com