Discussion:
[WiX-users] IIS Website Identifier / Site Id
Neil Sleightholm
2008-06-10 19:57:22 UTC
Permalink
When you use WiX to create a new website in IIS 6 it creates it with an
Identifier or Site Id of one more than the last website that was created
(this is the same as IIS 5). If you create it manually then IIS sets the
Identifier to a number based on the hash of the site name - the
algorithm for this is explained here on Mike Poulson's blog:
http://blogs.msdn.com/mpoulson/archive/2006/03/06/544893.aspx. To
summarise it creates the hash and then if that Identifier is in use it
just adds one until it finds an unused Identifier.



This method of creating Identifier's based on the hash of the name is
very useful when you have a farm of servers as it means that the
Identifier is not dependent on the order in which installs are run. For
in house websites you can arrange for the website names to have unique
hash values and be sure that all servers in a farm are identical and
even build servers with a subset of the sites that again are identical
to the original install. The identifier is also used for log file path,
so on a farm of servers it helps if the logs are all in known folders.



Now to my point, would it be possible to get this functionality built
into WiX v3?



A company I work for has already done it for WiX v2 but the approach was
to simply change the IIS site creation code to use the hashing method. I
suspect this is not the best approach to this but as we only target IIS
6 servers it hasn't caused a problem.



I am happy to share this code (it is a change to scaweb.cpp) and to try
to implement it in WiX v3 but I would like to know what other people
think about it and how best to approach it. Here are some of the issues
I see:

1. Should this value be automatically generated by the install?

2. Should it be possible to override the identifier value in WiX
when creating a site?

3. Should the default be the hashing method on IIS 6?

4. I haven't used IIS 7, does it use the same hashing scheme?



Neil



Neil Sleightholm
X2 Systems Limited
***@x2systems.com <mailto:***@x2systems.com>
Andrew Burgher
2008-06-10 22:28:15 UTC
Permalink
Hi Neil,

This would definitely be a welcome addition to the WiX toolset; and would be
great if you could help make it happen.

For installs targeting IIS6 my view is that the hashed id should be the
default behaviour - but also supporting specification of an explicit
identifier would give alot of flexibility too.

Good luck.

Cheers,
Andrew


-----Original Message-----
From: wix-users-***@lists.sourceforge.net
[mailto:wix-users-***@lists.sourceforge.net] On Behalf Of Neil
Sleightholm
Sent: Wednesday, 11 June 2008 5:57 AM
To: WiX Users
Subject: [WiX-users] IIS Website Identifier / Site Id

When you use WiX to create a new website in IIS 6 it creates it with an
Identifier or Site Id of one more than the last website that was created
(this is the same as IIS 5). If you create it manually then IIS sets the
Identifier to a number based on the hash of the site name - the
algorithm for this is explained here on Mike Poulson's blog:
http://blogs.msdn.com/mpoulson/archive/2006/03/06/544893.aspx. To
summarise it creates the hash and then if that Identifier is in use it
just adds one until it finds an unused Identifier.



This method of creating Identifier's based on the hash of the name is
very useful when you have a farm of servers as it means that the
Identifier is not dependent on the order in which installs are run. For
in house websites you can arrange for the website names to have unique
hash values and be sure that all servers in a farm are identical and
even build servers with a subset of the sites that again are identical
to the original install. The identifier is also used for log file path,
so on a farm of servers it helps if the logs are all in known folders.



Now to my point, would it be possible to get this functionality built
into WiX v3?



A company I work for has already done it for WiX v2 but the approach was
to simply change the IIS site creation code to use the hashing method. I
suspect this is not the best approach to this but as we only target IIS
6 servers it hasn't caused a problem.



I am happy to share this code (it is a change to scaweb.cpp) and to try
to implement it in WiX v3 but I would like to know what other people
think about it and how best to approach it. Here are some of the issues
I see:

1. Should this value be automatically generated by the install?

2. Should it be possible to override the identifier value in WiX
when creating a site?

3. Should the default be the hashing method on IIS 6?

4. I haven't used IIS 7, does it use the same hashing scheme?



Neil



Neil Sleightholm
X2 Systems Limited
***@x2systems.com <mailto:***@x2systems.com>



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
Neil Sleightholm
2008-06-11 15:38:49 UTC
Permalink
I have tried the hashing code on IIS 5 and it works but this doesn't match what would happen by default.

I think the website creation needs a parameter for SiteId which by default works as it currently does to avoid breaking existing installs. It should be possible to set this to default (as it works now), hash or a specific value.

I have remembered why we needed this to be an known repeatable value. If you are using a farm with a session state server all servers must have the same site Id as this is used to identify the session.

Neil

Neil Sleightholm
X2 Systems Limited
***@x2systems.com <mailto:***@x2systems.com>


________________________________

From: wix-users-***@lists.sourceforge.net on behalf of Andrew Burgher
Sent: Tue 10/06/2008 23:28
To: 'General discussion for Windows Installer XML toolset.'
Subject: Re: [WiX-users] IIS Website Identifier / Site Id



Hi Neil,

This would definitely be a welcome addition to the WiX toolset; and would be
great if you could help make it happen.

For installs targeting IIS6 my view is that the hashed id should be the
default behaviour - but also supporting specification of an explicit
identifier would give alot of flexibility too.

Good luck.

Cheers,
Andrew


-----Original Message-----
From: wix-users-***@lists.sourceforge.net
[mailto:wix-users-***@lists.sourceforge.net] On Behalf Of Neil
Sleightholm
Sent: Wednesday, 11 June 2008 5:57 AM
To: WiX Users
Subject: [WiX-users] IIS Website Identifier / Site Id

When you use WiX to create a new website in IIS 6 it creates it with an
Identifier or Site Id of one more than the last website that was created
(this is the same as IIS 5). If you create it manually then IIS sets the
Identifier to a number based on the hash of the site name - the
algorithm for this is explained here on Mike Poulson's blog:
http://blogs.msdn.com/mpoulson/archive/2006/03/06/544893.aspx. To
summarise it creates the hash and then if that Identifier is in use it
just adds one until it finds an unused Identifier.



This method of creating Identifier's based on the hash of the name is
very useful when you have a farm of servers as it means that the
Identifier is not dependent on the order in which installs are run. For
in house websites you can arrange for the website names to have unique
hash values and be sure that all servers in a farm are identical and
even build servers with a subset of the sites that again are identical
to the original install. The identifier is also used for log file path,
so on a farm of servers it helps if the logs are all in known folders.



Now to my point, would it be possible to get this functionality built
into WiX v3?



A company I work for has already done it for WiX v2 but the approach was
to simply change the IIS site creation code to use the hashing method. I
suspect this is not the best approach to this but as we only target IIS
6 servers it hasn't caused a problem.



I am happy to share this code (it is a change to scaweb.cpp) and to try
to implement it in WiX v3 but I would like to know what other people
think about it and how best to approach it. Here are some of the issues
I see:

1. Should this value be automatically generated by the install?

2. Should it be possible to override the identifier value in WiX
when creating a site?

3. Should the default be the hashing method on IIS 6?

4. I haven't used IIS 7, does it use the same hashing scheme?



Neil



Neil Sleightholm
X2 Systems Limited
***@x2systems.com <mailto:***@x2systems.com>



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
WiX-users mailing list
WiX-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
Bob Arnson
2008-06-11 16:03:08 UTC
Permalink
Post by Neil Sleightholm
I have remembered why we needed this to be an known repeatable value. If you are using a farm with a session state server all servers must have the same site Id as this is used to identify the session.
I don't do IIS but that seems reasonable.
--
sig://boB
http://joyofsetup.com/
Rob Mensching
2008-06-12 00:49:12 UTC
Permalink
Interesting, didn't know the SiteId was used in farm settings. Leave to the IIS team to take something that had no meaning and assign meaning to it later. <sigh/>

Please do open a bug.

-----Original Message-----
From: wix-users-***@lists.sourceforge.net [mailto:wix-users-***@lists.sourceforge.net] On Behalf Of Neil Sleightholm
Sent: Wednesday, June 11, 2008 08:39
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] IIS Website Identifier / Site Id

I have tried the hashing code on IIS 5 and it works but this doesn't match what would happen by default.

I think the website creation needs a parameter for SiteId which by default works as it currently does to avoid breaking existing installs. It should be possible to set this to default (as it works now), hash or a specific value.

I have remembered why we needed this to be an known repeatable value. If you are using a farm with a session state server all servers must have the same site Id as this is used to identify the session.

Neil

Neil Sleightholm
X2 Systems Limited
***@x2systems.com <mailto:***@x2systems.com>


________________________________

From: wix-users-***@lists.sourceforge.net on behalf of Andrew Burgher
Sent: Tue 10/06/2008 23:28
To: 'General discussion for Windows Installer XML toolset.'
Subject: Re: [WiX-users] IIS Website Identifier / Site Id



Hi Neil,

This would definitely be a welcome addition to the WiX toolset; and would be great if you could help make it happen.

For installs targeting IIS6 my view is that the hashed id should be the default behaviour - but also supporting specification of an explicit identifier would give alot of flexibility too.

Good luck.

Cheers,
Andrew


-----Original Message-----
From: wix-users-***@lists.sourceforge.net
[mailto:wix-users-***@lists.sourceforge.net] On Behalf Of Neil Sleightholm
Sent: Wednesday, 11 June 2008 5:57 AM
To: WiX Users
Subject: [WiX-users] IIS Website Identifier / Site Id

When you use WiX to create a new website in IIS 6 it creates it with an Identifier or Site Id of one more than the last website that was created (this is the same as IIS 5). If you create it manually then IIS sets the Identifier to a number based on the hash of the site name - the algorithm for this is explained here on Mike Poulson's blog:
http://blogs.msdn.com/mpoulson/archive/2006/03/06/544893.aspx. To summarise it creates the hash and then if that Identifier is in use it just adds one until it finds an unused Identifier.



This method of creating Identifier's based on the hash of the name is very useful when you have a farm of servers as it means that the Identifier is not dependent on the order in which installs are run. For in house websites you can arrange for the website names to have unique hash values and be sure that all servers in a farm are identical and even build servers with a subset of the sites that again are identical to the original install. The identifier is also used for log file path, so on a farm of servers it helps if the logs are all in known folders.



Now to my point, would it be possible to get this functionality built into WiX v3?



A company I work for has already done it for WiX v2 but the approach was to simply change the IIS site creation code to use the hashing method. I suspect this is not the best approach to this but as we only target IIS
6 servers it hasn't caused a problem.



I am happy to share this code (it is a change to scaweb.cpp) and to try to implement it in WiX v3 but I would like to know what other people think about it and how best to approach it. Here are some of the issues I see:

1. Should this value be automatically generated by the install?

2. Should it be possible to override the identifier value in WiX
when creating a site?

3. Should the default be the hashing method on IIS 6?

4. I haven't used IIS 7, does it use the same hashing scheme?



Neil



Neil Sleightholm
X2 Systems Limited
***@x2systems.com <mailto:***@x2systems.com>



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
WiX-users mailing list
WiX-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for just about anything Open Source.
http://sourceforge.net/services/buy/index.php
Luke Bakken
2008-06-12 14:10:42 UTC
Permalink
On Wed, Jun 11, 2008 at 5:49 PM, Rob Mensching
Post by Rob Mensching
Interesting, didn't know the SiteId was used in farm settings. Leave to the IIS team to take something that had no meaning and assign meaning to it later. <sigh/>
I did some poking around and found the following....

When you run "aspnet_regsql -d test -S localhost -E -ssadd -sstype c"
to create the ASP session state tables and stored procs, you'll see
that the "dbo.ASPStateTempSessions" table has a SessionId column.

You'll find that System.Web.SessionState.SqlSessionStateStore has a
method called InitSqlInfo() that calls the dbo.TempGetAppID stored
procedure to get the "_appSuffix" value, which is later used as part
of the SessionId. Notice the parameter "appName" to this stored
procedure is HttpRuntime.AppDomainAppIdInternal (which is an
internalized AppDomainAppId). This (drum roll) does contain the site
id. Here's the value of HttpRuntime.AppDomainAppId from my XP 5.1 IIS
server for a test page I have:

HttpRuntime.AppDomainAppId is /LM/W3SVC/1/Root/vars

"1" is the site id value from the metabase.

This means that servers in a farm must have the same site id if they
want to share the same sql-based ASP session state provider.
Neil Sleightholm
2008-06-12 16:39:33 UTC
Permalink
I have raised a bug:
http://sourceforge.net/tracker/index.php?func=detail&aid=1992202&group_i
d=105970&atid=642714 and included the information from this thread in
it.

Personally I think this is something that would need to be fix for v3
release but I do write a lot of website installs!

Neil

-----Original Message-----
From: wix-users-***@lists.sourceforge.net
[mailto:wix-users-***@lists.sourceforge.net] On Behalf Of Rob
Mensching
Sent: 12 June 2008 01:49
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] IIS Website Identifier / Site Id

Interesting, didn't know the SiteId was used in farm settings. Leave to
the IIS team to take something that had no meaning and assign meaning to
it later. <sigh/>

Please do open a bug.

Rob Mensching
2008-06-12 00:37:03 UTC
Permalink
Yeah, the IIS team mentioned we should do this but never gave us a good reason to go about doing it. So, I went and focused on things that were obviously bugs.

Why does it matter?

-----Original Message-----
From: wix-users-***@lists.sourceforge.net [mailto:wix-users-***@lists.sourceforge.net] On Behalf Of Neil Sleightholm
Sent: Tuesday, June 10, 2008 12:57
To: WiX Users
Subject: [WiX-users] IIS Website Identifier / Site Id

When you use WiX to create a new website in IIS 6 it creates it with an
Identifier or Site Id of one more than the last website that was created
(this is the same as IIS 5). If you create it manually then IIS sets the
Identifier to a number based on the hash of the site name - the
algorithm for this is explained here on Mike Poulson's blog:
http://blogs.msdn.com/mpoulson/archive/2006/03/06/544893.aspx. To
summarise it creates the hash and then if that Identifier is in use it
just adds one until it finds an unused Identifier.



This method of creating Identifier's based on the hash of the name is
very useful when you have a farm of servers as it means that the
Identifier is not dependent on the order in which installs are run. For
in house websites you can arrange for the website names to have unique
hash values and be sure that all servers in a farm are identical and
even build servers with a subset of the sites that again are identical
to the original install. The identifier is also used for log file path,
so on a farm of servers it helps if the logs are all in known folders.



Now to my point, would it be possible to get this functionality built
into WiX v3?



A company I work for has already done it for WiX v2 but the approach was
to simply change the IIS site creation code to use the hashing method. I
suspect this is not the best approach to this but as we only target IIS
6 servers it hasn't caused a problem.



I am happy to share this code (it is a change to scaweb.cpp) and to try
to implement it in WiX v3 but I would like to know what other people
think about it and how best to approach it. Here are some of the issues
I see:

1. Should this value be automatically generated by the install?

2. Should it be possible to override the identifier value in WiX
when creating a site?

3. Should the default be the hashing method on IIS 6?

4. I haven't used IIS 7, does it use the same hashing scheme?



Neil



Neil Sleightholm
X2 Systems Limited
***@x2systems.com <mailto:***@x2systems.com>



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
Loading...