-2

In Windows Server 2008 we can host multiple websites under a single IP by relying on Host headers. My problem is I have only one IP address and I want to dedicate it to a single application like below:

Host : * (for any host header. to provide *.example.com)
IP : 192.108.0.0
Port : 80

Now I want to do this with another application, too, like this:

Host : * (for any host header. to provide *.domain2.com)
IP : 192.108.0.0
Port : 80

I can't use the same IP twice because it will create a conflict. So I thought I would use an alternative to port 80 and redo the second application like below:

Host : * (for any host header. to provide *.domain2.com)
IP : 192.108.0.0
Port : 234

Is this possible? Can I then connect to domain2.com without specifying the port in the URL?

Need this => domain2.com
Not this => domain2.com:234

I am using IIS.

Vinoth Kannan
  • 47
  • 1
  • 2
  • 9

2 Answers2

2

No, you can't run on a different port than port 80 without specifying the port in the URL.

But why can't you just set your web server to provide the first site when the Host: header matches "*.example.com" and the second site when it matches "*.domain2.com"? (Someone might even be able to tell you how to do that if you tell us what web server you're using.)

wfaulk
  • 6,828
  • 7
  • 45
  • 75
  • @wafaulk yes we can use just "example.com". but my problem is i want host header like *.example.com & *.domain2.com. if i leave host header field as blank then any host header which one pointing to this ip will work automatically. So i can easily get unlimited subdomains without manual creation by single DNS A record. for example "anyhostheader.blogspot.com" – Vinoth Kannan May 09 '12 at 23:00
  • I understand, but, depending on your web server, you might be able to use wildcards exactly like in your comment, which would make more sense. – wfaulk May 09 '12 at 23:02
  • @wafualk am unable to create multiple wildcard domains with a single ip – Vinoth Kannan May 09 '12 at 23:06
  • in iis we can't use any host header with a symbol like * in website bindings – Vinoth Kannan May 09 '12 at 23:09
0

If you're using Apache you can use name based virtual hosts. It provides a solution to this exact situation whereby it will answer for any domain you wish on the same IP address.