0

We have 2 servers, In server1, IIS configuration has a virtual directory which has the HTML page of the URL.

In server2, IIS configuration the virtual directory points to the directory in server1(same directory configured in server1).

while accessing the URL by localhost in server1 displays a General error as mentioned in the config file, whereas accessing the URL by localhost in server2 displays Runtime error(mentioned below) although it points to the same config which server 1 points. There is no access issue between the servers.

Server Error in '/' Application

Runtime Error:

Description: An exception occurred while processing your request. Additionally, another exception occurred while executing the custom error page for the first exception. The request has been terminated.

Web Config:-

<customErrors defaultredirect="GeneralErrorPage.htm" mode ="On">
<error statuscode="404" redirect="GeneralErrorPage.htm"/>
</customErrors>
  1. set <customErrors mode="Off" /> and
  • Hosted the url in server1 as http://localhost/buyer/ displays General error
  • Hosted the url in server2 as http://localhost/buyer/ displays Runtime Error
  1. The virtual directory buyer in IIS has lot of *.html pages Hosted the url in server1 and server 2 as http://localhost/buyer/info.html displays the UI page of the buyer info

Its very clear that server2 has no issues while accessing the directory "buyer" in server1.

  <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
         
            <httpErrors errorMode="Custom">
                <remove statusCode="404" subStatusCode="-1" />
                <remove statusCode="403" subStatusCode="-1" />
                <error statusCode="403" prefixLanguageFilePath="" path="/GeneralErrorPage.htm" responseMode="ExecuteURL" />
                <error statusCode="404" prefixLanguageFilePath="" path="/GeneralErrorPage.htm" responseMode="Redirect"  />
               
            </httpErrors>
            <directoryBrowse enabled="false" />
       </system.webServer>
    <system.web>

      <customErrors defaultRedirect="GeneralErrorPage.htm" mode="Off">
       <error statusCode="404" redirect="GeneralErrorPage.htm"/>
      </customErrors>

</system.web>
</configuration>

Note: Manually When I append the html pages (GeneralErr.htm) in the same url http://localhost/subtest/GeneralErr.htm, the page gets loaded sucessfully.

But While hosting the url http://localhost/subtest from server 2 getting the below error - Getting access error or runtime error

Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: An error occurred loading a configuration file: Failed to start monitoring changes to '\server1\c$\test\subtest' because access is denied.

Regarding IIS configuration for virtual directory using IIS8 version

In Server1 folder structure: c:\test\subtest

In Server2 : IIS configuration for virtual directory "subtest" Physical Path : \server1\c$\test\subtest Physical Path Credentials: domain\username Virtual Path: /subtest

5
  • First, you need to modify the webconfig according to the error prompts and set <customErrors mode="Off" />, so that more detailed errors can be displayed. Secondly, you can try to directly use the URL to access the site in server1, so you can determine whether the problem comes from server1 or server2. Finally, enable failed request tracking on the server where the problem occurred. Commented Oct 20, 2020 at 5:39
  • I have modified the webconfig as <customErrors mode="Off" /> and updated above. But unable to identify the problem.. Commented Oct 21, 2020 at 10:23
  • @Bruce Zhang Any input required to resolve the error Commented Oct 21, 2020 at 12:48
  • After setting custom error mode to off, detailed error information should be displayed on the page. You should find the problem based on the detailed error information. It is difficult to find the cause of the problem just by looking at your error description and configuration file. At the same time, you should also enable failed request tracking, and analyze the logs of both on server1 and server2. Or use event view to view errors. Commented Oct 22, 2020 at 9:08
  • @Bruce Zhang: I have added some note in above main thread. Commented Oct 23, 2020 at 15:30

1 Answer 1

0

The 500.19 error you get at the beginning is just like the error description says that absolute paths are not allowed, but relative paths should be used. So you can set the relative path to solve this problem, or enable the absolute path in applicationhost, follow the underlined part of the configuration.

<httpErrors allowAbsolutePathsWhenDelegated="true" errorMode="Custom" lockAttributes="allowAbsolutePathsWhenDelegated,defaultPath">
  ...
</httpErrors>

Even if the relative path is enabled, there will still be problems when accessing through localhsot/subtest.

There are two ways to solve this problem, one is to modify the application pool to “No managed code" and "Classic" settings. The other is to modify the identity of the application pool, set it to a user with the same permissions as the administrator, you can create one User or directly use the administrator.

Sign up to request clarification or add additional context in comments.

2 Comments

Whats the significiance of choosing "No manage Code" in IIS app pool? Will the change impacts the .NET application ?
It's to do with whether or not IIS will attempt to pass incoming requests to handlers that use .NET Framework. By switching managed code off, the .NET Framework CLR does not get loaded into the app pool process, which can speed up startup and request processing for apps that only use handlers built with native code (e.g. classic ASP). When you specify .NET CLR version as 4.0 for an application pool, IIS tried to load into its worker processes some ASP.NET supporting libraries. Such increases memory usage and attack surface, and might also have other impact.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.