开发者

ApplicationPool ProcessModel Identity fails when installed via cmd line

开发者 https://www.devze.com 2023-03-26 16:31 出处:网络
I have a WCF service which I install via cmd line, due to installment on many servers! When installi开发者_运维百科ng application pool and configuring it, I set a custom account on the process model

I have a WCF service which I install via cmd line, due to installment on many servers!

When installi开发者_运维百科ng application pool and configuring it, I set a custom account on the process model identity, which is just an account with local administrator rights!

But when I try to browse the service just to see the front service page I get a Service Unavailable message with http error 503, which is a server error which again comes from an event id 5021, which states that the identity for the service's application pool is invalid due to either incorrect username/password or the user may not have batch logon rights.

Ergo, the error has to do with the user identity! When I change Identity to NetworkService there is no problem. I cannot either manually set the Identity to the user...

My cmd line looks like:

c:\Windows\System32\inetsrv\appcmd add apppool /name:"calendarproviderservice" ^ /autostart:"true" ^ /managedRuntimeVersion:"v4.0" ^ /processModel.idleTimeout:"24:00:00" ^ /enable32BitAppOnWin64:"true" ^ /processmodel.identitytype:"SpecificUser" ^ /processModel.userName:"PlannerAdmin"

Anyone has a clue...?

Cheers, Finn.


It's been a while, but I finally solved my problem! Unfortunately I didn't sketch the hole scenario in the main question because I didn't think it mattedered in the context. But it did!

The scenario was that my server was a deployed server with a base configuration including IIS 7.5! And this is the problem!

When you try to set the application pool identity to a domain account, IIS has to keep a local copy of your username and password. This is stored in IIS applicationHost.config in encrypted format. In the encryption IIS uses the machine specific keys in iisConfiguration and iisWasKey containers. When this applicationHost.config is moved to a different server (in this case the deployed server on new hardware), IIS can no longer decrypt the password because of the new machine keys.

One can export configuration Keys, but I already deleted the base server I made an image of!

So the lesson learned here is: If you have to deploy many servers with IIS on, make a base image WITHOUT IIS, and script the IIS on the server after deployment!!!

Cheers, Finn.

PS. Dominik, sorry that I wasn't that clear on the intro question!


Have you assigned the user to the local IIS_USRS group?

0

精彩评论

暂无评论...
验证码 换一张
取 消