Problem with Host Header Names on IIS 6.0

Problem with Host Header Names on IIS 6.0

am 07.09.2007 18:31:33 von Gregory Pagan

I have an IIS 6.0 server on Windows Server 2003 SP1.

My parent site has some child sites defined on it. The child site
directories are at the same same level as the parent site. For example in
the wwwroot directory there is the default.asp home page for the entire
site, for discussion purposes called Father. There are also child site
directories at the wwwroot directory level such as james, john, and fred.
Currently if you want to access the child site james directly you enterthe
address parent site name\child site name like father\james and then the
james homepage comes up. When I look at the directory tab under
properties for james, it shows the Application Name as james and the
starting point as father\james. All code on the james site uses the syntax
father\james\ to reference the asp files and other code that run the site.

I need to make the james site directly accessable with out typing the father
site first. I read up on Host Headers as what I thought would be the best
way to accomplish this task since I do not have slots to put more Ethernet
connections on the server and the idea of typing in a port number after the
site name was not appealing to the customers.

I tried to set up the Host Header information like the instructions on the
Microsoft site outlined. I created a new site in IIS, used the same IP
address and port number as the father site and entered the host header
information as james.mycompany.com, and then entered the path as
e:\inetpub\wwwroot\james. This created the site successfully. I also
created a DNS alias record that pointed the james.mycompany.com IP
information to the same address as the father site. When you try to access
the site by entering just james, it finds the default home page but all the
file name references used by default home page are a level off. They have
embedded in the code the father\james directory reference not just the james
reference.

When I look at the main site for james it shows the local path as
e:\inetpub\wwwroot\james, the application name as james but the starting
point is also james. Is there a way to move the starting point to
father\james again?

Or is there a better way to get the father\james site to be accessable as
just james?

Any help or direction would be greatly appreciated.

Greg

Re: Problem with Host Header Names on IIS 6.0

am 08.09.2007 04:31:01 von Steve Schofield

Did you try putting 'Father' just that in the host-header field along with
'Father.mydomain.com'?

You could also look at using something like ISAPI-Rewrite
www.isapirewrite.com

--

Steve Schofield
Windows Server MVP - IIS
http://weblogs.asp.net/steveschofield


"Gregory Pagan" wrote in message
news:e7rBOyW8HHA.5456@TK2MSFTNGP05.phx.gbl...
>I have an IIS 6.0 server on Windows Server 2003 SP1.
>
> My parent site has some child sites defined on it. The child site
> directories are at the same same level as the parent site. For example in
> the wwwroot directory there is the default.asp home page for the entire
> site, for discussion purposes called Father. There are also child site
> directories at the wwwroot directory level such as james, john, and fred.
> Currently if you want to access the child site james directly you
> enterthe address parent site name\child site name like father\james and
> then the james homepage comes up. When I look at the directory tab
> under properties for james, it shows the Application Name as james and the
> starting point as father\james. All code on the james site uses the
> syntax father\james\ to reference the asp files and other code that run
> the site.
>
> I need to make the james site directly accessable with out typing the
> father site first. I read up on Host Headers as what I thought would be
> the best way to accomplish this task since I do not have slots to put more
> Ethernet connections on the server and the idea of typing in a port number
> after the site name was not appealing to the customers.
>
> I tried to set up the Host Header information like the instructions on the
> Microsoft site outlined. I created a new site in IIS, used the same IP
> address and port number as the father site and entered the host header
> information as james.mycompany.com, and then entered the path as
> e:\inetpub\wwwroot\james. This created the site successfully. I also
> created a DNS alias record that pointed the james.mycompany.com IP
> information to the same address as the father site. When you try to
> access the site by entering just james, it finds the default home page but
> all the file name references used by default home page are a level off.
> They have embedded in the code the father\james directory reference not
> just the james reference.
>
> When I look at the main site for james it shows the local path as
> e:\inetpub\wwwroot\james, the application name as james but the starting
> point is also james. Is there a way to move the starting point to
> father\james again?
>
> Or is there a better way to get the father\james site to be accessable as
> just james?
>
> Any help or direction would be greatly appreciated.
>
> Greg
>

Re: Problem with Host Header Names on IIS 6.0

am 08.09.2007 10:15:49 von David Wang

On Sep 7, 9:31 am, "Gregory Pagan" wrote:
> I have an IIS 6.0 server on Windows Server 2003 SP1.
>
> My parent site has some child sites defined on it. The child site
> directories are at the same same level as the parent site. For example in
> the wwwroot directory there is the default.asp home page for the entire
> site, for discussion purposes called Father. There are also child site
> directories at the wwwroot directory level such as james, john, and fred.
> Currently if you want to access the child site james directly you enterthe
> address parent site name\child site name like father\james and then the
> james homepage comes up. When I look at the directory tab under
> properties for james, it shows the Application Name as james and the
> starting point as father\james. All code on the james site uses the syntax
> father\james\ to reference the asp files and other code that run the site.
>
> I need to make the james site directly accessable with out typing the father
> site first. I read up on Host Headers as what I thought would be the best
> way to accomplish this task since I do not have slots to put more Ethernet
> connections on the server and the idea of typing in a port number after the
> site name was not appealing to the customers.
>
> I tried to set up the Host Header information like the instructions on the
> Microsoft site outlined. I created a new site in IIS, used the same IP
> address and port number as the father site and entered the host header
> information as james.mycompany.com, and then entered the path as
> e:\inetpub\wwwroot\james. This created the site successfully. I also
> created a DNS alias record that pointed the james.mycompany.com IP
> information to the same address as the father site. When you try to access
> the site by entering just james, it finds the default home page but all the
> file name references used by default home page are a level off. They have
> embedded in the code the father\james directory reference not just the james
> reference.
>
> When I look at the main site for james it shows the local path as
> e:\inetpub\wwwroot\james, the application name as james but the starting
> point is also james. Is there a way to move the starting point to
> father\james again?
>
> Or is there a better way to get the father\james site to be accessable as
> just james?
>
> Any help or direction would be greatly appreciated.
>
> Greg



This sounds like an issue with the application you are trying to
modify, and you really need to obtain support from that application's
support personel on whether this is possible and if so, how to do
this.

You may think this is an issue with IIS because all you did was create
a new website with its root pointing into an existing and otherwise
functioning application, and the new website does not work -- so the
problem is IIS, right?

But, it sounds like a problem with how the application rebases itself
relative to the root of its website.

Because it sounds like the code uses hardcoded references to "Father
\James" with "Father" mapping to the root of the website, originally e:
\inetpub\wwwroot, and "James" mapping to a folder under the root.
Because that's the way the application was designed.

What you did when you created the website james.mycompany.com was that
you changed the root of this new website to e:\inetpub\wwwroot\james.
This means that the application's references to "Father\James" now
access e:\inetpub\wwwroot\james\james -- one level lower than expected
-- and weird behavior can ensue.

Now, since you MUST map james.mycompany.com to e:\inetpub\wwwroot
\james, it means you MUST find a way to tell the application that
"Father" is not the root of the website but rather "e:\inetpub
\wwwroot". You can do this in a variety of ways, depending on how the
application rebases itself.

Whether this is supported depends on the application. I also have no
idea whether the application supports promoting the child site to be
accessed like a parent, as the root of a website. After all, this is a
problem with the application and not IIS.


//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//

Re: Problem with Host Header Names on IIS 6.0

am 11.09.2007 00:28:21 von Gregory Pagan

I had not thought of that since if I do that won't I end up with Father's
homepage when I use james as the URL?

Greg

"Steve Schofield" wrote in message
news:uFt9MBc8HHA.3900@TK2MSFTNGP02.phx.gbl...
> Did you try putting 'Father' just that in the host-header field along with
> 'Father.mydomain.com'?
>
> You could also look at using something like ISAPI-Rewrite
> www.isapirewrite.com
>
> --
>
> Steve Schofield
> Windows Server MVP - IIS
> http://weblogs.asp.net/steveschofield
>
>
> "Gregory Pagan" wrote in message
> news:e7rBOyW8HHA.5456@TK2MSFTNGP05.phx.gbl...
>>I have an IIS 6.0 server on Windows Server 2003 SP1.
>>
>> My parent site has some child sites defined on it. The child site
>> directories are at the same same level as the parent site. For example
>> in the wwwroot directory there is the default.asp home page for the
>> entire site, for discussion purposes called Father. There are also child
>> site directories at the wwwroot directory level such as james, john, and
>> fred. Currently if you want to access the child site james directly you
>> enterthe address parent site name\child site name like father\james and
>> then the james homepage comes up. When I look at the directory tab
>> under properties for james, it shows the Application Name as james and
>> the starting point as father\james. All code on the james site uses the
>> syntax father\james\ to reference the asp files and other code that run
>> the site.
>>
>> I need to make the james site directly accessable with out typing the
>> father site first. I read up on Host Headers as what I thought would be
>> the best way to accomplish this task since I do not have slots to put
>> more Ethernet connections on the server and the idea of typing in a port
>> number after the site name was not appealing to the customers.
>>
>> I tried to set up the Host Header information like the instructions on
>> the Microsoft site outlined. I created a new site in IIS, used the same
>> IP address and port number as the father site and entered the host header
>> information as james.mycompany.com, and then entered the path as
>> e:\inetpub\wwwroot\james. This created the site successfully. I also
>> created a DNS alias record that pointed the james.mycompany.com IP
>> information to the same address as the father site. When you try to
>> access the site by entering just james, it finds the default home page
>> but all the file name references used by default home page are a level
>> off. They have embedded in the code the father\james directory reference
>> not just the james reference.
>>
>> When I look at the main site for james it shows the local path as
>> e:\inetpub\wwwroot\james, the application name as james but the starting
>> point is also james. Is there a way to move the starting point to
>> father\james again?
>>
>> Or is there a better way to get the father\james site to be accessable as
>> just james?
>>
>> Any help or direction would be greatly appreciated.
>>
>> Greg
>>
>

Re: Problem with Host Header Names on IIS 6.0

am 11.09.2007 00:33:39 von Gregory Pagan

David,

You are correct in that the real problem is not with IIS but with the
application. I was just wondering if there were a simple way to get around
the application coding issue that would allow me to repoint one time the
location of the father\james directory so it would recognise the pathing
model that the application is using.

I believe the bottom line is that the application should change since it is
there idea to create the an alias to their site to begin with.


Greg

"David Wang" wrote in message
news:1189239349.701153.245780@g4g2000hsf.googlegroups.com...
> On Sep 7, 9:31 am, "Gregory Pagan" wrote:
>> I have an IIS 6.0 server on Windows Server 2003 SP1.
>>
>> My parent site has some child sites defined on it. The child site
>> directories are at the same same level as the parent site. For example
>> in
>> the wwwroot directory there is the default.asp home page for the entire
>> site, for discussion purposes called Father. There are also child site
>> directories at the wwwroot directory level such as james, john, and fred.
>> Currently if you want to access the child site james directly you
>> enterthe
>> address parent site name\child site name like father\james and then the
>> james homepage comes up. When I look at the directory tab under
>> properties for james, it shows the Application Name as james and the
>> starting point as father\james. All code on the james site uses the
>> syntax
>> father\james\ to reference the asp files and other code that run the
>> site.
>>
>> I need to make the james site directly accessable with out typing the
>> father
>> site first. I read up on Host Headers as what I thought would be the
>> best
>> way to accomplish this task since I do not have slots to put more
>> Ethernet
>> connections on the server and the idea of typing in a port number after
>> the
>> site name was not appealing to the customers.
>>
>> I tried to set up the Host Header information like the instructions on
>> the
>> Microsoft site outlined. I created a new site in IIS, used the same IP
>> address and port number as the father site and entered the host header
>> information as james.mycompany.com, and then entered the path as
>> e:\inetpub\wwwroot\james. This created the site successfully. I also
>> created a DNS alias record that pointed the james.mycompany.com IP
>> information to the same address as the father site. When you try to
>> access
>> the site by entering just james, it finds the default home page but all
>> the
>> file name references used by default home page are a level off. They
>> have
>> embedded in the code the father\james directory reference not just the
>> james
>> reference.
>>
>> When I look at the main site for james it shows the local path as
>> e:\inetpub\wwwroot\james, the application name as james but the starting
>> point is also james. Is there a way to move the starting point to
>> father\james again?
>>
>> Or is there a better way to get the father\james site to be accessable as
>> just james?
>>
>> Any help or direction would be greatly appreciated.
>>
>> Greg
>
>
>
> This sounds like an issue with the application you are trying to
> modify, and you really need to obtain support from that application's
> support personel on whether this is possible and if so, how to do
> this.
>
> You may think this is an issue with IIS because all you did was create
> a new website with its root pointing into an existing and otherwise
> functioning application, and the new website does not work -- so the
> problem is IIS, right?
>
> But, it sounds like a problem with how the application rebases itself
> relative to the root of its website.
>
> Because it sounds like the code uses hardcoded references to "Father
> \James" with "Father" mapping to the root of the website, originally e:
> \inetpub\wwwroot, and "James" mapping to a folder under the root.
> Because that's the way the application was designed.
>
> What you did when you created the website james.mycompany.com was that
> you changed the root of this new website to e:\inetpub\wwwroot\james.
> This means that the application's references to "Father\James" now
> access e:\inetpub\wwwroot\james\james -- one level lower than expected
> -- and weird behavior can ensue.
>
> Now, since you MUST map james.mycompany.com to e:\inetpub\wwwroot
> \james, it means you MUST find a way to tell the application that
> "Father" is not the root of the website but rather "e:\inetpub
> \wwwroot". You can do this in a variety of ways, depending on how the
> application rebases itself.
>
> Whether this is supported depends on the application. I also have no
> idea whether the application supports promoting the child site to be
> accessed like a parent, as the root of a website. After all, this is a
> problem with the application and not IIS.
>
>
> //David
> http://w3-4u.blogspot.com
> http://blogs.msdn.com/David.Wang
> //
>

Re: Problem with Host Header Names on IIS 6.0

am 11.09.2007 05:26:06 von David Wang

I cannot think of a "simple" way to get around the application coding
issue.

The application likely retrieves the physical path that the "root" of
the website points to via the ISAPI function call
HSE_REQ_MAP_URL_TO_PATH (higher-level application frameworks like ASP/
ASP.Net expose that function call with Server.MapPath() or
equivalent).

You will either need to change:
1. The application code to interpret Server.MapPath() differently
2. What IIS returns for HSE_REQ_MAP_URL_TO_PATH

There is no configuration in IIS that lets you do the whacky
configuration of "let's both simultaneously change and NOT change the
URL to physical mapping".

Now, #1 is far more preferable because it is a small change limited to
the application.

You can do #2 by writing an ISAPI Filter which listens on
SF_NOTIFY_URL_MAP event to alter the URL-to-FileSystemPathname
mapping, but that is usually across the entire server, which can have
all sorts of other whacky, unintended effects if you don't write the
filter properly.

While #2 is code that can be written by anyone, practically speaking,
it can only be written correctly by a few people. This task is no
easier than #1, which is code that can only be written by the
application developer correctly. Both options require specific people
writing specific code, at which point I have to ask you which person
do you think is easier to find to accomplish what you want?


//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//





On Sep 10, 3:33 pm, "Gregory Pagan" wrote:
> David,
>
> You are correct in that the real problem is not with IIS but with the
> application. I was just wondering if there were a simple way to get around
> the application coding issue that would allow me to repoint one time the
> location of the father\james directory so it would recognise the pathing
> model that the application is using.
>
> I believe the bottom line is that the application should change since it is
> there idea to create the an alias to their site to begin with.
>
> Greg
>
> "David Wang" wrote in message
>
> news:1189239349.701153.245780@g4g2000hsf.googlegroups.com...
>
>
>
> > On Sep 7, 9:31 am, "Gregory Pagan" wrote:
> >> I have an IIS 6.0 server on Windows Server 2003 SP1.
>
> >> My parent site has some child sites defined on it. The child site
> >> directories are at the same same level as the parent site. For example
> >> in
> >> the wwwroot directory there is the default.asp home page for the entire
> >> site, for discussion purposes called Father. There are also child site
> >> directories at the wwwroot directory level such as james, john, and fred.
> >> Currently if you want to access the child site james directly you
> >> enterthe
> >> address parent site name\child site name like father\james and then the
> >> james homepage comes up. When I look at the directory tab under
> >> properties for james, it shows the Application Name as james and the
> >> starting point as father\james. All code on the james site uses the
> >> syntax
> >> father\james\ to reference the asp files and other code that run the
> >> site.
>
> >> I need to make the james site directly accessable with out typing the
> >> father
> >> site first. I read up on Host Headers as what I thought would be the
> >> best
> >> way to accomplish this task since I do not have slots to put more
> >> Ethernet
> >> connections on the server and the idea of typing in a port number after
> >> the
> >> site name was not appealing to the customers.
>
> >> I tried to set up the Host Header information like the instructions on
> >> the
> >> Microsoft site outlined. I created a new site in IIS, used the same IP
> >> address and port number as the father site and entered the host header
> >> information as james.mycompany.com, and then entered the path as
> >> e:\inetpub\wwwroot\james. This created the site successfully. I also
> >> created a DNS alias record that pointed the james.mycompany.com IP
> >> information to the same address as the father site. When you try to
> >> access
> >> the site by entering just james, it finds the default home page but all
> >> the
> >> file name references used by default home page are a level off. They
> >> have
> >> embedded in the code the father\james directory reference not just the
> >> james
> >> reference.
>
> >> When I look at the main site for james it shows the local path as
> >> e:\inetpub\wwwroot\james, the application name as james but the starting
> >> point is also james. Is there a way to move the starting point to
> >> father\james again?
>
> >> Or is there a better way to get the father\james site to be accessable as
> >> just james?
>
> >> Any help or direction would be greatly appreciated.
>
> >> Greg
>
> > This sounds like an issue with the application you are trying to
> > modify, and you really need to obtain support from that application's
> > support personel on whether this is possible and if so, how to do
> > this.
>
> > You may think this is an issue with IIS because all you did was create
> > a new website with its root pointing into an existing and otherwise
> > functioning application, and the new website does not work -- so the
> > problem is IIS, right?
>
> > But, it sounds like a problem with how the application rebases itself
> > relative to the root of its website.
>
> > Because it sounds like the code uses hardcoded references to "Father
> > \James" with "Father" mapping to the root of the website, originally e:
> > \inetpub\wwwroot, and "James" mapping to a folder under the root.
> > Because that's the way the application was designed.
>
> > What you did when you created the website james.mycompany.com was that
> > you changed the root of this new website to e:\inetpub\wwwroot\james.
> > This means that the application's references to "Father\James" now
> > access e:\inetpub\wwwroot\james\james -- one level lower than expected
> > -- and weird behavior can ensue.
>
> > Now, since you MUST map james.mycompany.com to e:\inetpub\wwwroot
> > \james, it means you MUST find a way to tell the application that
> > "Father" is not the root of the website but rather "e:\inetpub
> > \wwwroot". You can do this in a variety of ways, depending on how the
> > application rebases itself.
>
> > Whether this is supported depends on the application. I also have no
> > idea whether the application supports promoting the child site to be
> > accessed like a parent, as the root of a website. After all, this is a
> > problem with the application and not IIS.
>
> > //David
> >http://w3-4u.blogspot.com
> >http://blogs.msdn.com/David.Wang
> > //- Hide quoted text -
>
> - Show quoted text -