Host Headers on Laptop running local

Host Headers on Laptop running local

am 17.09.2007 20:22:03 von BobTheHacker

I have two web sites I want to host on a laptop for demos. So my IP address
will be the same and I just can't seem to get it work.

I have set both to "All unasigned IPs" and I have tried "127.0.0.1" and that
does not work.

I gernally access the web sites on the laptop as http://127.0.0.1/appname
based on what I have read on host headers it has to be the fully qualified
name and it will only let me enter something like www.appname.com. And that
won't work either.

Do I need to add something to my lmhost ?

I found that if I enter my "appname" as the header, it tries to resolve one
of the sites but I get a 400 error because it does not resolve far enough
down to get my login.asp.

Re: Host Headers on Laptop running local

am 17.09.2007 21:25:57 von Kristofer Gafvert

I will assume that you are using an IIS version that supports multiple
websites, such as IIS 6 on Windows Server 2003 or IIS 5 on Windows 2000
Server.

In your example using "appname" as host header, the client must be able to
resolve "appname" to the IP address of the webserver (127.0.0.1). So you
will need to add it to the lmhosts file. And i think that this is the part
you are missing.

If you have this working, and you get a 400, we need to know your exact
settings. Most likely, this status code is returned because the host
header value you sent to the webserver does not match any host header you
have set up in IIS. But to be able to help, we need to know your settings
and what you sent to IIS (the URL).

These articles may also be interesting:

"Using Host Headers to host multiple websites on IIS 6.0"
http://www.gafvert.info/iis/article/iis_multiple_websites.ht m

"Understanding Host Headers in IIS"
http://www.gafvert.info/iis/article/understanding_host_heade rs.htm

"Test host header configuration with the hosts file"
http://www.gafvert.info/iis/article/hosts_file_host_headers. htm


--
Regards,
Kristofer Gafvert
http://www.gafvert.info/iis/ - IIS Related Info


BobTheHacker wrote:

>I have two web sites I want to host on a laptop for demos. So my IP
>address
>will be the same and I just can't seem to get it work.
>
>I have set both to "All unasigned IPs" and I have tried "127.0.0.1" and
>that
>does not work.
>
>I gernally access the web sites on the laptop as http://127.0.0.1/appname
>based on what I have read on host headers it has to be the fully qualified
>name and it will only let me enter something like www.appname.com. And
>that
>won't work either.
>
>Do I need to add something to my lmhost ?
>
>I found that if I enter my "appname" as the header, it tries to resolve one
>of the sites but I get a 400 error because it does not resolve far enough
>down to get my login.asp.

Re: Host Headers on Laptop running local

am 17.09.2007 21:57:33 von BobTheHacker

That is correct IIS 6.0. I now get my default document, which should forward
me to my actual authentication page and it simply hangs. Here is the HTML
that is used for it.

META HTTP-EQUIV="refresh" content="5;url=/aspcode/logon.asp


What I do in the logon.asp is get some server variables and display a "login
button" as well as some other links. I have left the web settings as they
stand (parent paths etc) since it all works if I turn off all the other pages.



"Kristofer Gafvert" wrote:

> I will assume that you are using an IIS version that supports multiple
> websites, such as IIS 6 on Windows Server 2003 or IIS 5 on Windows 2000
> Server.
>
> In your example using "appname" as host header, the client must be able to
> resolve "appname" to the IP address of the webserver (127.0.0.1). So you
> will need to add it to the lmhosts file. And i think that this is the part
> you are missing.
>
> If you have this working, and you get a 400, we need to know your exact
> settings. Most likely, this status code is returned because the host
> header value you sent to the webserver does not match any host header you
> have set up in IIS. But to be able to help, we need to know your settings
> and what you sent to IIS (the URL).
>
> These articles may also be interesting:
>
> "Using Host Headers to host multiple websites on IIS 6.0"
> http://www.gafvert.info/iis/article/iis_multiple_websites.ht m
>
> "Understanding Host Headers in IIS"
> http://www.gafvert.info/iis/article/understanding_host_heade rs.htm
>
> "Test host header configuration with the hosts file"
> http://www.gafvert.info/iis/article/hosts_file_host_headers. htm
>
>
> --
> Regards,
> Kristofer Gafvert
> http://www.gafvert.info/iis/ - IIS Related Info
>
>
> BobTheHacker wrote:
>
> >I have two web sites I want to host on a laptop for demos. So my IP
> >address
> >will be the same and I just can't seem to get it work.
> >
> >I have set both to "All unasigned IPs" and I have tried "127.0.0.1" and
> >that
> >does not work.
> >
> >I gernally access the web sites on the laptop as http://127.0.0.1/appname
> >based on what I have read on host headers it has to be the fully qualified
> >name and it will only let me enter something like www.appname.com. And
> >that
> >won't work either.
> >
> >Do I need to add something to my lmhost ?
> >
> >I found that if I enter my "appname" as the header, it tries to resolve one
> >of the sites but I get a 400 error because it does not resolve far enough
> >down to get my login.asp.
>

Re: Host Headers on Laptop running local

am 17.09.2007 22:10:43 von Kristofer Gafvert

Can you get the logon page using:

http://name/aspcode/logon.asp

What is logged in the IIS log file?

Setting a host header should have no affect at all on this. Unless your
code does something that makes it hang.

--
Regards,
Kristofer Gafvert
http://www.gafvert.info/iis/ - IIS Related Info


BobTheHacker wrote:

>That is correct IIS 6.0. I now get my default document, which should
>forward
>me to my actual authentication page and it simply hangs. Here is the HTML
>that is used for it.
>
>META HTTP-EQUIV="refresh" content="5;url=/aspcode/logon.asp
>
>
>What I do in the logon.asp is get some server variables and display a
>"login
>button" as well as some other links. I have left the web settings as they
>stand (parent paths etc) since it all works if I turn off all the other
>pages.
>
>
>
>"Kristofer Gafvert" wrote:
>
>>I will assume that you are using an IIS version that supports multiple
>>websites, such as IIS 6 on Windows Server 2003 or IIS 5 on Windows 2000
>>Server.
>>
>>In your example using "appname" as host header, the client must be able to
>>resolve "appname" to the IP address of the webserver (127.0.0.1). So you
>>will need to add it to the lmhosts file. And i think that this is the part
>>you are missing.
>>
>>If you have this working, and you get a 400, we need to know your exact
>>settings. Most likely, this status code is returned because the host
>>header value you sent to the webserver does not match any host header you
>>have set up in IIS. But to be able to help, we need to know your settings
>>and what you sent to IIS (the URL).
>>
>>These articles may also be interesting:
>>
>>"Using Host Headers to host multiple websites on IIS 6.0"
>>http://www.gafvert.info/iis/article/iis_multiple_websites. htm
>>
>>"Understanding Host Headers in IIS"
>>http://www.gafvert.info/iis/article/understanding_host_hea ders.htm
>>
>>"Test host header configuration with the hosts file"
>>http://www.gafvert.info/iis/article/hosts_file_host_header s.htm
>>
>>
>>--
>>Regards,
>>Kristofer Gafvert
>>http://www.gafvert.info/iis/ - IIS Related Info
>>
>>
>>BobTheHacker wrote:
>>
>>>I have two web sites I want to host on a laptop for demos. So my IP
>>>address
>>>will be the same and I just can't seem to get it work.
>>>
>>>I have set both to "All unasigned IPs" and I have tried "127.0.0.1" and
>>>that
>>>does not work.
>>>
>>>I gernally access the web sites on the laptop as http://127.0.0.1/appname
>>>based on what I have read on host headers it has to be the fully
>>>qualified
>>>name and it will only let me enter something like www.appname.com. And
>>>that
>>>won't work either.
>>>
>>>Do I need to add something to my lmhost ?
>>>
>>>I found that if I enter my "appname" as the header, it tries to resolve
>>>one
>>>of the sites but I get a 400 error because it does not resolve far enough
>>>down to get my login.asp.
>>

Re: Host Headers on Laptop running local

am 17.09.2007 22:16:01 von BobTheHacker

Hey I got it all to work. For some reason I had to add it to my trusted
sites list to get the refresh to work and the active x warning to go away!

Thanks for the help

"Kristofer Gafvert" wrote:

> I will assume that you are using an IIS version that supports multiple
> websites, such as IIS 6 on Windows Server 2003 or IIS 5 on Windows 2000
> Server.
>
> In your example using "appname" as host header, the client must be able to
> resolve "appname" to the IP address of the webserver (127.0.0.1). So you
> will need to add it to the lmhosts file. And i think that this is the part
> you are missing.
>
> If you have this working, and you get a 400, we need to know your exact
> settings. Most likely, this status code is returned because the host
> header value you sent to the webserver does not match any host header you
> have set up in IIS. But to be able to help, we need to know your settings
> and what you sent to IIS (the URL).
>
> These articles may also be interesting:
>
> "Using Host Headers to host multiple websites on IIS 6.0"
> http://www.gafvert.info/iis/article/iis_multiple_websites.ht m
>
> "Understanding Host Headers in IIS"
> http://www.gafvert.info/iis/article/understanding_host_heade rs.htm
>
> "Test host header configuration with the hosts file"
> http://www.gafvert.info/iis/article/hosts_file_host_headers. htm
>
>
> --
> Regards,
> Kristofer Gafvert
> http://www.gafvert.info/iis/ - IIS Related Info
>
>
> BobTheHacker wrote:
>
> >I have two web sites I want to host on a laptop for demos. So my IP
> >address
> >will be the same and I just can't seem to get it work.
> >
> >I have set both to "All unasigned IPs" and I have tried "127.0.0.1" and
> >that
> >does not work.
> >
> >I gernally access the web sites on the laptop as http://127.0.0.1/appname
> >based on what I have read on host headers it has to be the fully qualified
> >name and it will only let me enter something like www.appname.com. And
> >that
> >won't work either.
> >
> >Do I need to add something to my lmhost ?
> >
> >I found that if I enter my "appname" as the header, it tries to resolve one
> >of the sites but I get a 400 error because it does not resolve far enough
> >down to get my login.asp.
>