IIS / Hosts Issue?
am 23.11.2007 20:29:09 von jrcapp
I hope this is the correct newsgroup! Here is my issue:
I am trying to create multiple web sites in IIS on my development box.
we'll say the IP of this box is 10.20.30.40. I created two new sites
in IIS, assigned it to that IP address (there is more than one IP on
this box) and assigned to the two sites host header names of "site1"
and site2".
I also added these entries to the "hosts" files as such:
10.20.30.40 site1
10.20.30.40 site2
When I go to http://site1/ or http://site2/ from the development box,
everything works! Yea!!
HOWEVER, when I try to go to http://site1/ or http://site2/ from any
other machine on the network, it doesn't work. I just get the "IE
cannot display the web page" error.
Any thoughts?
Thanks!!
Jeremy
Re: IIS / Hosts Issue?
am 23.11.2007 20:34:44 von jrcapp
One other thing, if I try to go to the IP address from another machine
on the network (http://10.20.30.40), I get a different error. I get a
400 Bad Request error.
Oh, and obviously, these Web sites are Intranet sites.
Thanks!
Re: IIS / Hosts Issue?
am 24.11.2007 09:49:59 von Kristofer Gafvert
The hosts file is a local file, so if you modified it on the development
machine it will only work from this machine. You must edit the hosts file on
all computers that will use site1 and site2.
--
Regards,
Kristofer Gafvert
http://www.gafvert.info/iis/ - IIS Related Info
skrev i meddelandet
news:54ff257c-045b-4dec-88cc-0c5e71c6fdaa@s12g2000prg.google groups.com...
>I hope this is the correct newsgroup! Here is my issue:
>
> I am trying to create multiple web sites in IIS on my development box.
> we'll say the IP of this box is 10.20.30.40. I created two new sites
> in IIS, assigned it to that IP address (there is more than one IP on
> this box) and assigned to the two sites host header names of "site1"
> and site2".
>
> I also added these entries to the "hosts" files as such:
>
> 10.20.30.40 site1
> 10.20.30.40 site2
>
> When I go to http://site1/ or http://site2/ from the development box,
> everything works! Yea!!
>
> HOWEVER, when I try to go to http://site1/ or http://site2/ from any
> other machine on the network, it doesn't work. I just get the "IE
> cannot display the web page" error.
>
> Any thoughts?
>
> Thanks!!
> Jeremy
Re: IIS / Hosts Issue?
am 24.11.2007 09:50:58 von Kristofer Gafvert
Probably because you have modified IIS to require a host header, and when
you accessed it with the IP it was not sent, or it did not match any of the
host header names you require.
--
Regards,
Kristofer Gafvert
http://www.gafvert.info/iis/ - IIS Related Info
skrev i meddelandet
news:3a0701ff-7bab-4cb0-a958-2a37b9384b0a@j44g2000hsj.google groups.com...
> One other thing, if I try to go to the IP address from another machine
> on the network (http://10.20.30.40), I get a different error. I get a
> 400 Bad Request error.
>
> Oh, and obviously, these Web sites are Intranet sites.
>
> Thanks!
Re: IIS / Hosts Issue?
am 24.11.2007 18:53:07 von jrcapp
Thanks for the reply, but I'm afriad I do not understand what you mean
or what you are suggesting to fix the issue.
On Nov 24, 2:50 am, "Kristofer Gafvert"
wrote:
> Probably because you have modifiedIISto require a host header, and when
> you accessed it with the IP it was not sent, or it did not match any of the
> host header names you require.
>
> --
> Regards,
> Kristofer Gafverthttp://www.gafvert.info/iis/-IISRelated Info
>
> skrev i meddelandetnews:3a0701ff-7bab-4cb0-a958-2a37b9384b0a@j44g200 0hsj.googlegroups.com...
>
>
>
> > One other thing, if I try to go to the IP address from another machine
> > on the network (http://10.20.30.40), I get a different error. I get a
> > 400 Bad Request error.
>
> > Oh, and obviously, these Web sites are Intranet sites.
>
> > Thanks!- Hide quoted text -
>
> - Show quoted text -
Re: IIS / Hosts Issue?
am 25.11.2007 04:08:50 von David Wang
Kristofer is telling you why your problem happens. You need to
determine how you want to resolve your issue. Here's what has
happened.
1. You configured the websites in IIS to require host headers (like
site1 and site2).
2. You configured hosts file so that the browser knows to send the
host header. Thus, it works on the dev box and everything looks good!
Yea!!
However, this does not work from another machine right now for exactly
the same reasons -- you failed to configure hosts file on all those
machines such that they know "site1" and "site2" is supposed to go to
the IIS server.
Thus, when you typed in http://site1 on those computers, the browser
displays "Page not found" error -- BECAUSE those computers do not know
the IP for "site1". They don't have the hosts file.
And when you typed in the IP addresses on those computers (to bypass
the IP lookup which is failing because you didn't configure hosts file
on those computers), the request is now rejected by IIS with 400 Bad
Request BECAUSE you configured IIS to *require* host headers like
"site1".
Now, all this *looks* complicated but is really not. Your setup is
mostly fine. The major problem is that computers don't have DNS lookup
to associate names like "site1" or "site2" with the IP of the IIS
server.
There are a variety of ways to address this DNS lookup problem,
depending on what you want to do. The basic ideas are:
- If this is just for testing, then copy the hosts file from your dev
box to these other machines (just for testing, after all).
- If this is for Internet deployment, then you'll want to look up how
to add and modify DNS records for site1 and site2, and make those
records point to an IP that either forwards directly to your IIS, or
is listened in directly by IIS.
//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//
On Nov 24, 9:53 am, "jrc...@cre8iveweb.com"
wrote:
> Thanks for the reply, but I'm afriad I do not understand what you mean
> or what you are suggesting to fix the issue.
>
> On Nov 24, 2:50 am, "Kristofer Gafvert"
> wrote:
>
>
>
> > Probably because you have modifiedIISto require a host header, and when
> > you accessed it with the IP it was not sent, or it did not match any of the
> > host header names you require.
>
> > --
> > Regards,
> > Kristofer Gafverthttp://www.gafvert.info/iis/-IISRelatedInfo
>
> > skrev i meddelandetnews:3a0701ff-7bab-4cb0-a958-2a37b9384b0a@j44g200 0hsj.googlegroups.com...
>
> > > One other thing, if I try to go to the IP address from another machine
> > > on the network (http://10.20.30.40), I get a different error. I get a
> > > 400 Bad Request error.
>
> > > Oh, and obviously, these Web sites are Intranet sites.
>
> > > Thanks!- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
Re: IIS / Hosts Issue?
am 25.11.2007 18:04:59 von jrcapp
David,
You da man. Thank you very much for explaining the issue in
detail. That makes complete sense. So, in order for this to work, I
need to set up either DNS or WINS on the Dev box?
Thanks a bunch,
Jeremy
Re: IIS / Hosts Issue?
am 25.11.2007 19:27:08 von Kristofer Gafvert
You need to set it up on a machine that other machines will use for name
resolution.
Say that you set up a DNS server on your development machine with IP
10.20.30.40, but all machines on the network use 10.20.30.41 as DNS server,
then your settings on the development machine will be useless, because the
other machines will not use it.
--
Regards,
Kristofer Gafvert
http://www.gafvert.info/iis/ - IIS Related Info
skrev i meddelandet
news:1d183cda-072a-415c-8e32-c6ce9e2c8638@s36g2000prg.google groups.com...
> David,
> You da man. Thank you very much for explaining the issue in
> detail. That makes complete sense. So, in order for this to work, I
> need to set up either DNS or WINS on the Dev box?
>
> Thanks a bunch,
> Jeremy
Re: IIS / Hosts Issue?
am 26.11.2007 02:57:02 von jrcapp
I see. So, back at my old job, they had several intranets. They would
somehow set it up so when anyone on the network (1000+ users) went to
http://intranet/ anyone could see the site. How did they do that? I
know they didn't update the "hosts" file on all 1000 machines?
Sorry if I'm being a pain! Thanks for all your help.
Jeremy
On Nov 25, 12:27 pm, "Kristofer Gafvert"
wrote:
> You need to set it up on a machine that other machines will use for name
> resolution.
>
> Say that you set up a DNS server on your development machine with IP
> 10.20.30.40, but all machines on the network use 10.20.30.41 as DNS server,
> then your settings on the development machine will be useless, because the
> other machines will not use it.
>
> --
> Regards,
> Kristofer Gafverthttp://www.gafvert.info/iis/-IISRelated Info
>
> skrev i meddelandetnews:1d183cda-072a-415c-8e32-c6ce9e2c8638@s36g200 0prg.googlegroups.com...
>
>
>
> > David,
> > You da man. Thank you very much for explaining the issue in
> > detail. That makes complete sense. So, in order for this to work, I
> > need to set up either DNS or WINS on the Dev box?
>
> > Thanks a bunch,
> > Jeremy- Hide quoted text -
>
> - Show quoted text -
Re: IIS / Hosts Issue?
am 26.11.2007 06:41:08 von Kristofer Gafvert
They probably had a DNS server and configured all clients to use that DNS
server. That can be done via a policy, so no need to go physically to each
computer.
--
Regards,
Kristofer Gafvert
http://www.gafvert.info/iis/ - IIS Related Info
skrev i meddelandet
news:0cc45367-d2c5-4f5a-943a-88fcd9ad6f72@w40g2000hsb.google groups.com...
>I see. So, back at my old job, they had several intranets. They would
> somehow set it up so when anyone on the network (1000+ users) went to
> http://intranet/ anyone could see the site. How did they do that? I
> know they didn't update the "hosts" file on all 1000 machines?
>
> Sorry if I'm being a pain! Thanks for all your help.
>
> Jeremy
>
> On Nov 25, 12:27 pm, "Kristofer Gafvert"
> wrote:
>> You need to set it up on a machine that other machines will use for name
>> resolution.
>>
>> Say that you set up a DNS server on your development machine with IP
>> 10.20.30.40, but all machines on the network use 10.20.30.41 as DNS
>> server,
>> then your settings on the development machine will be useless, because
>> the
>> other machines will not use it.
>>
>> --
>> Regards,
>> Kristofer Gafverthttp://www.gafvert.info/iis/-IISRelated Info
>>
>> skrev i
>> meddelandetnews:1d183cda-072a-415c-8e32-c6ce9e2c8638@s36g200 0prg.googlegroups.com...
>>
>>
>>
>> > David,
>> > You da man. Thank you very much for explaining the issue in
>> > detail. That makes complete sense. So, in order for this to work, I
>> > need to set up either DNS or WINS on the Dev box?
>>
>> > Thanks a bunch,
>> > Jeremy- Hide quoted text -
>>
>> - Show quoted text -
>
Re: IIS / Hosts Issue?
am 26.11.2007 15:13:16 von jrcapp
Ok, thanks!
On Nov 25, 11:41 pm, "Kristofer Gafvert"
wrote:
> They probably had a DNS server and configured all clients to use that DNS
> server. That can be done via a policy, so no need to go physically to each
> computer.
>
> --
> Regards,
> Kristofer Gafverthttp://www.gafvert.info/iis/-IISRelated Info
>
> skrev i meddelandetnews:0cc45367-d2c5-4f5a-943a-88fcd9ad6f72@w40g200 0hsb.googlegroups.com...
>
>
>
> >I see. So, back at my old job, they had several intranets. They would
> > somehow set it up so when anyone on the network (1000+ users) went to
> >http://intranet/anyone could see the site. How did they do that? I
> > know they didn't update the "hosts" file on all 1000 machines?
>
> > Sorry if I'm being a pain! Thanks for all your help.
>
> > Jeremy
>
> > On Nov 25, 12:27 pm, "Kristofer Gafvert"
> > wrote:
> >> You need to set it up on a machine that other machines will use for name
> >> resolution.
>
> >> Say that you set up a DNS server on your development machine with IP
> >> 10.20.30.40, but all machines on the network use 10.20.30.41 as DNS
> >> server,
> >> then your settings on the development machine will be useless, because
> >> the
> >> other machines will not use it.
>
> >> --
> >> Regards,
> >> Kristofer Gafverthttp://www.gafvert.info/iis/-IISRelatedInfo
>
> >> skrev i
> >> meddelandetnews:1d183cda-072a-415c-8e32-c6ce9e2c8638@s36g200 0prg.googlegroups.com...
>
> >> > David,
> >> > You da man. Thank you very much for explaining the issue in
> >> > detail. That makes complete sense. So, in order for this to work, I
> >> > need to set up either DNS or WINS on the Dev box?
>
> >> > Thanks a bunch,
> >> > Jeremy- Hide quoted text -
>
> >> - Show quoted text -- Hide quoted text -
>
> - Show quoted text -