Attempting to configure the application in IIS gives me an error: Error message 401.2 .: Unauthorized: Login failed due to server configuration

I created the web application by going to IIS, right-clicking on the default Web site and selecting Add Application . Then I give an alias, select DefaultAppPool and point it to the physical path.

When I try to go to http: // localhost / mywebapp , I get "Access Deprived " with the following data:

Error message 401.2 .: Unauthorized message: Login failed due to configuration server. Make sure you have permission to view this directory. or a page based on the credentials you provided and the authentication methods included on the web server. Contact the admin web server for further assistance.

  • Anonymous authentication is enabled on the IIS website.
  • The web application is an ASP.NET MVC5 application.
  • The web application runs under the default property: ApplicationPoolIdentity

Below are the settings for DefaultAppPool

enter image description here

+4
source share
3 answers

Make sure your application is not located in a network share or in the Windows users directory (magic). (It could be in the default magic user directory for Visual Studio if you follow my instructions below)

If you are on Win7, create a new MVC 3 application, ^ F5 to run. Then, in the Solution Explorer, right-click the project and select properties. In the left pane, select the Web tab. The default is Cassini (use Visual Studio Development Server). Select the following radio, use the local IIS web server. Now ^ F5, and it will launch your application from IIS. You can also find your application in IIS Manager and in the right pane, select view 80. Now that it works, compare the differences in the two applications.

Your approach should also work. You can try creating a new MVC application and use your approach for testing in IIS. The most common mistake is creating a vDir, not an application

The error message is pretty good. To set ACLS in the application pool identifier, follow the instructions in the Resource Security section at http://learn.iis.net/page.aspx/624/application-pool-identities/

Also see Understanding Built-in User and Group Accounts in IIS 7

If the new MVC application should fail, repeat, but create a Web Forms application.

+4
source

Make sure IUSR has permission to the directory where webapp is located.

In addition, if your application gets access to resources (File IO, MSMQ ... etc.), you will have to change the Identity the application pool or make sure that ISUR has permission.

+1
source

Ensure that the NETWORK SERVICE account (or any other IIS system account) has permissions to the application folder.

To check the system account in use, go to the application pool settings and the system account will be listed on the Identity tab:

enter image description here

EDIT

Verify that the application is using the correct application pool. Also, if you have not specified a default document yet, this may be your problem. You can verify this by including the page name in the URL, for example. http://localhost/mywebapp/default.aspx

0
source

Source: https://habr.com/ru/post/1379328/


All Articles