Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
What web server are you using? –  wfaulk May 9 '12 at 23:07
    
Windows Server 2008 with IIS 7 –  Codeel Technologies May 9 '12 at 23:13

2 Answers 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.)

share|improve this answer
    
@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" –  Codeel Technologies May 9 '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 9 '12 at 23:02
    
@wafualk am unable to create multiple wildcard domains with a single ip –  Codeel Technologies May 9 '12 at 23:06
    
in iis we can't use any host header with a symbol like * in website bindings –  Codeel Technologies May 9 '12 at 23:09

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.

share|improve this answer
    
it may be. but am using windows server 2008 :( –  Codeel Technologies May 9 '12 at 23:10
    
@Svinn - Apache does run under Windows. I think you mean to indicate you're using IIS –  Mark Henderson May 9 '12 at 23:11
    
yes using IIS 7 @wfaulk –  Codeel Technologies May 9 '12 at 23:16
    
@Svinn IIS does name based virtual hosts too –  Zypher May 9 '12 at 23:23
    
bcoz of this dirk.net/2008/05/28/… i cant use name based virtual hosts for wildcards –  Codeel Technologies May 9 '12 at 23:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.