views:

15

answers:

1

We have a remote webserver with two IP addresses. Can we put several web applications on this server organized like this? I am putting xttp instead of http because stackoverflow thinks I'm trying to add real links.

xttp://www.ourdomain.com
xttp://dogs.ourdomain.com
xttps://securedogs.ourdomain.com
xttps://securecats.ourdomain.com
xttp://cats.ourdomain.com

That is, where the applications associated with a couple of the subdomains use https while others use http.

Each subdomain doesn't need its own IP address, does it?

Thanks

A: 

It is not necessary to use separate IP addresses for each site you are hosting. IIS and Apache can recognize which site the user wants by the host headers--that is, by the URL the user is requesting.

Here's a good how-to page for IIS 6.0, which is the built-in web server on Windows Server 2003. And here is a good how-to for Apache Server, if that's your preference.

Note that this only works if all the sites are managed by the same server (IIS or Apache). If you are using instances of Rails, Django, or other web application/frameworks, then it requires a little more elbow grease: typically, you would configure each instance to use a different port, and the put an IIS or Apache server in front to silently redirect to the appropriate ports.

ewall
the exception to that is SSL. you have to assign a separate IP address to a web site that uses SSL.
Moose
@Moose Oh yes, thanks for the reminder! And @Tim had a couple SSL sites he wanted to use... I suppose technically you *can* have multiple sites with different host headers using a generically-named SSL certificate (this is how most cheap web hosting companies allow it), but pretty much every browser will complain that the name on the SSL certificate doesn't match the target domain name.
ewall
So, if I understand correctly, we'd devote one IP address to HTTPS and the other to HTTP? So I could have two separate web applications running on the secure IP: xttps://secure.ourdomain.com/cats and xttps://secure.ourdomain.com/dogs ?
Tim
ewall
Thanks for the clarification.
Tim

related questions