如何将IIS应用程序池标识用户区域设置为ApplicationPoolIdentity时,如何设置它 [英] How do you set the IIS Application Pool Identity User Locale when it's set to ApplicationPoolIdentity

查看:771
本文介绍了如何将IIS应用程序池标识用户区域设置为ApplicationPoolIdentity时,如何设置它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

澄清标题。

在IIS中创建应用程序池时,请为其命名。然后,您可以将身份设置为ApplicationPoolIdentiy。

When you create an application pool in IIS you give it a name. You can then set the identity to ApplicationPoolIdentiy.

Windows然后创建您无法看到的魔术用户。假设应用程序池名称是MyTestAppPool,那么最终会得到一个名为MyTestAppPool的用户(IIS AppPool \ MyTestAppPool)

Windows then creates this magic user you can't see. Say the app pool name is MyTestAppPool so you would end up with a user called MyTestAppPool (IIS AppPool\MyTestAppPool)

当发生这种情况时,Windows会使用服务器当前区域设置。让我们说当时是美国。

When this happens Windows uses the servers current locale. Let's say it was US at the time.

然后你将它改为英国。虽然有一个副本,但这并没有复制到我发现的这些魔术用户。因此,当您的MyTestAppPool设置为US时,您的服务器将设置为UK。

Then later you change it to UK. While there is a copy this doesn't copy to these magic users I've found. So your server is set to UK while your MyTestAppPool is set to US.

因此,当网站运行时,您需要在正确的区域设置中将某些内容格式化为货币由于AppPool而不是英国货币而使用美国货币。

So when a website runs and you need to say format something to currency in the correct locale you end up with US currency because of the AppPool instead of UK currency.

有没有办法更改AppPool用户的区域设置?

Is there a way to change the AppPool user's locale?

我找到的唯一方法是删除应用程序池并在将服务器区域设置设置为所需后再次重新创建它。如果我不想这样做会怎么样。

The only way I have found is to delete the app pool and recreate it again after you've set the servers locale to what you want. What if I don't want to do that.

如果我需要在不同的语言环境中运行多个网站怎么办?如何将AppPoolIdentity用户区域设置为每个在创建apppool之前,无需将服务器更改为我想要的内容?

What if I need to have multiple websites running in different locales how would I set the AppPoolIdentity user locale to each of these without having to change the server to what I want before I create the apppool?

推荐答案

创建和使用App Pool Identity时,创建用户并在 C:\ Users \ AppPoolName 中有一个文件夹。

When you create and use an App Pool Identity, a "user" is created and there is a folder at C:\Users\AppPoolName.

C:\ Windows \ System32 \inetsrv\config \ applicationHost.config 我的机器上有一个元素如下所示:

In C:\Windows\System32\inetsrv\config\applicationHost.config there is an element which on my machine looks like this:

<applicationPoolDefaults managedRuntimeVersion="v4.0">
  <processModel identityType="ApplicationPoolIdentity" loadUserProfile="true" setProfileEnvironment="false" />
</applicationPoolDefaults>

这两个设置的组合决定了应用程序池标识运行的环境(以及区域设置)设置。

The combination of these two settings determines the environment (and thus locale) settings that app pool identity runs as.

您应该可以通过检入 HKEY_LOCAL_MACHINE \SYSTEM\CurrentControlSet \Control \hivelist 用于加载 .. \Users\AppPoolName \NTUSER.DAT 的用户,然后将其与<$ c $中的设置进行匹配c> HKEY_USERS \UnqiueId \ControlPanel \ International \ Locale 设置。

You should be able to figure out the unique Id by checking in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\hivelist for the user that loads the ..\Users\AppPoolName\NTUSER.DAT and then match it up with the settings in HKEY_USERS\UnqiueId\ControlPanel\International\Locale settings.

设置<$ c $可能更简单c> setProfileEnvironment =false除非你需要这些设置。

It may just be simpler to set setProfileEnvironment="false" unless you need the settings.

这篇关于如何将IIS应用程序池标识用户区域设置为ApplicationPoolIdentity时,如何设置它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆