500.19 error in IIS7 when an error occurs
Asked Answered
P

5

21

Setup: Windows 7, IIS7. I am working on an app that is being viewed through the local IIS server, not the built in debugging web server. So my app url is http://localhost/foo/bar.aspx. There is no <customErrors> section in my web.config, and I haven't changed any settings in IIS.

If any error occurs, I always get the following error screen:

HTTP Error 500.19 - Internal Server Error
Absolute physical path "C:\inetpub\custerr" is not allowed in system.webServer/httpErrors section in web.config file. Use relative path instead.

Here's my applicationhost.config contents:

<httpErrors errorMode="Custom" lockAttributes="allowAbsolutePathsWhenDelegated,defaultPath">
  <error statusCode="401" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="401.htm" />
  <error statusCode="403" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="403.htm" />
  <error statusCode="404" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="404.htm" />
  <error statusCode="405" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="405.htm" />
  <error statusCode="406" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="406.htm" />
  <error statusCode="412" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="412.htm" />
  <error statusCode="500" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="500.htm" />
  <error statusCode="501" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="501.htm" />
  <error statusCode="502" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="502.htm" />
</httpErrors>

How can I get rid of this configuration error so I can see detailed errors?

Pamplona answered 18/3, 2010 at 19:37 Comment(0)
B
43

I've been dealing with this issue for the last few days and found the solution. A Web.Config file is likely specifying an absolute path for one of the error pages. This may not be the Web.Config of the application you are testing. For me, it was the website's Web.Config file.

  1. If you find the offending Web.Config file you can remove the absolute path and the problem should be fixed.

  2. A much easier solution would be to alter your ApplicationHost.Config file to set the allowAbsolutePathsWhenDelegated property to true:

    <httpErrors allowAbsolutePathsWhenDelegated="true" errorMode="Custom" 
                lockAttributes="allowAbsolutePathsWhenDelegated,defaultPath">
    
Byte answered 2/4, 2010 at 15:47 Comment(4)
it is not possible to upvote you enough. i had a web.config in my web site root. deleted everythign from there. yayayayayayaya!!!!!!!!Pamplona
#4358839Misquote
I have iis7.5 and vs2013 and this property is not allowed in the config file, after trying to push on this, the error still appears.Stribling
Actually this answer solved it for me!Stribling
H
2

I had the same problem when I installed Active Directory Certificate Services on the domain controller. Both of them were using port 443. I change the one for certificate services to the server IP Address and left the exchange server unassigned. That solved my problem.

Heiney answered 14/2, 2011 at 20:46 Comment(0)
B
1

I had this same issue in IIS 8.5. The fix was to delete any entries in the web.config file (located in the root directory of the website) that referenced the custom error pages. The entries were created by the system when I had attempted to make changes to custom pages.

Becharm answered 21/4, 2015 at 20:34 Comment(0)
A
1

What helped me to resolve this error is setting allowAbsolutePathsWhenDelegated to true.

Go to IIS > Configuration Editor > in Section type: system.webServer/httpErrors and Set allowAbsolutePathsWhenDelegated to true. Reset IIS for good measure.

Asturias answered 2/2, 2016 at 15:44 Comment(0)
S
0

For me the solution was to set custom account select application-->basic settings in the right pane--->connect as -->provide username and password then give this user full permissions on the project folder on inetpub>wwwroot>foldername

Stillborn answered 20/9, 2021 at 13:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.