[英]HTTP Error 500.19 - Internal Server Error IIS 7.5
I have a local copy of a web site that I know has a valid web.config file, it runs in production and in VIsual Studio 2013. It is running on .net version 4.0. 我有一个网站的本地副本,我知道它具有有效的web.config文件,该文件可以在生产环境中以及在VIsual Studio 2013中运行。它在.net 4.0版上运行。 I am getting the dreaded "HTTP Error 500.19 - Internal Server Error".
我收到了可怕的“ HTTP错误500.19-内部服务器错误”。 There is weird info in the config source section of the error page:
错误页面的config source部分中有奇怪的信息:
Config Source 配置源
-1: 0: -1: 0
Anyone ever see this one before and have any ideas how to resolve it? 有人以前见过这个,对解决它有任何想法吗? App Pool is set correctly and I checked permissions on the folder and added Everyone with full rights.
应用程序池设置正确,我检查了该文件夹的权限,并向所有人添加了完整权限。
Thanks! 谢谢!
There are many sources of this error – I seem to have hit most of them :(( 此错误有很多根源-我似乎已经击中了大多数:((
This applies to Win Server 2008 R2 64 bit SP1 & IIS 7.5. 这适用于Win Server 2008 R2 64位SP1和IIS 7.5。
.NET version different between Web-App & assigned Application Pool Web应用程序和分配的应用程序池之间的.NET版本不同
Generally, the web-app .NET version is specified in the Web.config file 通常,Web-app .NET版本是在Web.config文件中指定的
...
<system.web>
<httpRuntime targetFramework="4.5" />
<compilation targetFramework="4.5.2" />
...
The .NET version of the app-pool assigned to this application must be compatible 分配给此应用程序的应用程序池的.NET版本必须兼容
To get the app-pool that is assigned to a web-app 获取分配给网络应用的应用池
IIS Manager > [web-app] > Basic Settings > Application Pool
To set the .NET version of the app-pool 设置应用程序池的.NET版本
IIS Manager > Application Pools > [app-pool-name] > Basic Settings > .NET Framework Version
Generally, there are only two choices .NET 2.0.50727 and .NET 4.0.30319 通常,.NET 2.0.50727和.NET 4.0.30319只有两种选择
We have installed .NET 4.6.1 - (4.6.01055) but in IIS, only the above versions are shown. 我们已经安装了.NET 4.6.1-(4.6.01055),但是在IIS中,仅显示上述版本。
Web-App Physical Path set to a Mapped Folder Web应用程序物理路径设置为映射的文件夹
The physical path associated with the web-app must be a UNC path - not a mapped path. 与Web应用程序关联的物理路径必须是UNC路径-而不是映射路径。
IIS Manager > [web-app] > Basic Settings > Physical Path
this works: 这有效:
\\[server-name]\share
this fails: 这失败了:
M:\share
The reason is that mapped network drives only exist in your session, not the session that IIS is running. 原因是映射的网络驱动器仅存在于您的会话中,而不存在于IIS正在运行的会话中。
Web-App Physical Path Access Rights Web应用程序物理路径访问权限
The user-account set in the app-pool must have sufficient access rights to access the web-app physical path. 在应用程序池中设置的用户帐户必须具有足够的访问权限才能访问Web应用程序物理路径。
This user-account must be given these permissions (with inherited rights for sub-folders): 必须为该用户帐户授予以下权限(具有子文件夹的继承权限):
IIS 7.5 has a built-in virtual account 'ApplicationPoolIdentity' that can be used for all app-pools. IIS 7.5具有内置虚拟帐户“ ApplicationPoolIdentity”,该帐户可用于所有应用程序池。 When this built-in account is associated with an app-pool, IIS creates a new unique user-account for that app-pool.
当此内置帐户与应用程序池关联时,IIS将为该应用程序池创建一个新的唯一用户帐户。
If this default account mechanism is used, then the associated account on the IIS server must be given permissions via Windows Explorer using this format: 如果使用此默认帐户机制,则必须通过Windows Explorer使用以下格式为IIS服务器上的关联帐户授予权限:
IIS AppPool\<app-pool-name>
Note that the IIS server (where the app-pool resides) must be selected in 'Locations...' with the app-pool name in the above format (case-insensitive). 请注意,必须在“位置...”中选择具有以上格式(不区分大小写)的应用程序池名称的IIS服务器(应用程序池所在的位置)。 When you click 'Check Names', the unique app-pool account will then be resolved and can then be assigned the correct permissions.
当您单击“检查名称”时,将解析唯一的应用程序池帐户,然后可以为其分配正确的权限。
Because each app-pool must have a unique name, the associated account is also unique. 因为每个应用程序池必须具有唯一的名称,所以关联的帐户也是唯一的。
Rather than use the IIS built-in accounts, another option is to run the app-pool under a dedicated service account. 除了使用IIS内置帐户外,另一个选择是在专用服务帐户下运行应用程序池。 Using a service account means that the password does not expire (among other things).
使用服务帐户意味着密码不会过期(除其他外)。 The service account must be given the above permissions on the root folder.
服务帐户必须在根文件夹上具有上述权限。
A normal user account can also be used but this is not recommended because of password expiry and the associated access rights need to be carefully set. 也可以使用普通用户帐户,但是不建议这样做,因为密码已过期并且需要仔细设置相关的访问权限。
App-Pool Account Password Changed/Expired App-Pool帐户密码已更改/已过期
For the app-pool user-account, if this password has changed or expired, you need to explicitly updated the password in IIS 对于应用程序池用户帐户,如果此密码已更改或过期,则需要在IIS中显式更新密码
IIS Manager > Application Pools > [app-pool-name] > Advanced Settings > Process Model > Identity
This does not apply if you use the IIS built-in virtual account 'ApplicationPoolIdentity' - the created account does not have a password. 如果您使用IIS内置虚拟帐户“ ApplicationPoolIdentity”,则此方法不适用-创建的帐户没有密码。 Another reason to use the IIS virtual account mechanism.
使用IIS虚拟帐户机制的另一个原因。
URL Rewrite Module not installed 未安装URL重写模块
If the web-app uses rewrite rules, the URL rewrite module must be installed 如果网络应用使用重写规则,则必须安装URL重写模块
Rewrite rules may be specified in the Web.config file 重写规则可以在Web.config文件中指定
...
<rewrite>
<rules>
<rule name="Timesheets Index Rewrite" stopProcessing="true">
<match url="Timesheets/Index" ignoreCase="true" />
<action type="Redirect" redirectType="Permanent" url="Timesheets/Entries" />
</rule>
...
ASP.NET not registered in IIS 未在IIS中注册ASP.NET
Depending on the order in which IIS and .NET 4 are installed / updated, it may be necessary to re-register ASP.NET with IIS. 根据IIS和.NET 4的安装/更新顺序,可能需要向IIS重新注册ASP.NET。
To check, in a command prompt: 要检查,请在命令提示符下:
cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319
aspnet_regiis -lv
This should give something like 这应该给像
...
2.0.50727.0 C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll
4.0.30319.0 C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll
4.0.30319.0 C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll
Here, .NET 2 is registered for 64 bit apps and .NET 4 is registered for both 32 & 64 bit apps. 在此,.NET 2为64位应用程序注册,.NET 4为32和64位应用程序注册。
If your target framework & 32/64 bit config is not in the list: 如果您的目标框架和32/64位配置不在列表中:
aspnet_regiis -i
make sure your appPool is set to "Integrated" 确保您的appPool设置为“集成”
look at here the diferences between modes: 在这里查看模式之间的区别:
What is the difference between 'classic' and 'integrated' pipeline mode in IIS7? IIS7中的“经典”和“集成”管道模式有什么区别?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.