13 May 2004

ASP.NET Impersonation

I met problems on trying to run ASP.NET Web App on a Windows domain controller earlier on and here is why this happened.
First let’s have a look at the ASP.NET Impersonation model.
With IIS anonymous access enabled, depends on whether ASP.NET impersonation is enabled, an impersonated account is used. In machine.config file:


// impersonation enabled, will impersonate using account pass by IIS
<identity impersonate="true"/>
// authentication enabled and user account specified
<identity impersonate="true" name="domain\user" password="pwd"/>
// authentication disabled
<identity impersonate="false" />

1)If it is not, requests are made using the system-level process account. This account is configured in the element of the machine.config file.
2)If ASP.NET impersonation is enabled, requests are made either using the IIS anonymous access account (localmachine\IUSR_machinename by default) or using a user account specified in the element of the section. In addition, if no account is specified in the element of the section, then permissions for user accounts may be specified in the element of the section.
All accounts on a domain controller are domain accounts and local accounts- localmachinename\(accountName) does not exist. Therefore ASP.NET cannot be started. To overcome this, you can use the system account or you will need to explicitly define an account configured in the element of the machine.config file.

07 May 2004

CMS, work with template gallery in VS.NET

Symptom 1: On Loading Woodgrovenet.sln to VS.NET, there is complain: "Could not get the root template gallery"

Error message: The windows credentials provided could not be validated.

Reason: The user running Microsoft Visual Studio .NET is not in a Template Designer role or their role does not have access to the root template gallery. So need to run Site manager to add the current logon account as a Template Designer.

Symptom 2: Cannot modify Template Gallery Item
I am logon to NT and start a new CMS Web project with VS.NET. The NT logon I used was granted as Template Designer. I can see the whole project but cannot add/modify template gallery items.
Double check the Template Designer rights, found there isn’t Group rights granted to the project-top channel-http host header (same name).
After grant the rights explicitly, I can now Add/modify TGI in VS.NET.

06 May 2004

Accessing CMS sites off a root URL by sharing IP address and port number

In this scenario, we have a root IIS site and multiple CMS web application off this root on a development environment. Instead of configuring each into their own CMS environments, they share a same CMS db, users/roles scheme. So developers can easily switch between sites

The site structure looked like this:
http://mycms --IIS root
--WoodgroveNet --CMS –enable web app 1
--PetshopCom --CMS –enable web app 2
--WoodwidgetOrg --CMS –enable web app 3

Instead of accessing each by:
http://mycms/WoodgroveNet
http://mycms/PetshopCom
http://mycms/WoodwidgetOrg

We want:
http://WoodgroveNet
http://PetshopCom
http://WoodwidgetOrg

Here is how to achieve this:
Step 1. Make mycms CMS enabled
You can use MCMS SCA tool to assign read/write rights or manually map these virtual directories:
- NR((MCMS installation drive)\Program Files\Server\IIS_NR)
- MCMS((MCMS installation drive)\Program Files\Server\MCMS)
Copy ASP.NET Client API by run:
aspnet_regiis –c from the appropriate .Net framework directory. for v1.1 this is C:\WINNT\Microsoft.NET\Framework\v1.1.4322

You need to manually map IE Web Control API, SCA wouldn’t do it for you:
Create a virtual directory mycms/Webctrl_client that map to (IIS installation drive)\Inetpub\wwwroot\ webctrl_client

Step 2. Check and remove mycms Host Header Name if there is one.
In IIS Manager, mycms|properties(right click)|Web Site Tab Web Site Identification, click “Advanced”. Now into Advanced Multiple Web Site Configuration.
To remove it, select the entry then click “Edit”.

Step 3. Add multiple website.
Into Advanced Multiple Web Site Configuration, click on “Add”. Use the same IP address and Port you assign to mycms for WoodgroveNet, PetshopCom and WoodwidgetOrg.

Step 4. Update DNS hosts file
notepad c:\winnt\system32\drivers\etc\hosts
add this: mycms woodgrovenet PetshopCom WoodwidgetOrg
you should use the IP address you assign to mycms.

You are done.