Home > other >  Windows Server 2019: IIS 10: HTTP Error 403.14 - Forbidden: The Web server is configured to not list
Windows Server 2019: IIS 10: HTTP Error 403.14 - Forbidden: The Web server is configured to not list

Time:12-14

All,

I am migrating a working .Net Framework Website from IIS 8.5 on a Microsoft Windows Server 2012 to IIS 10 on a Microsoft Windows Server 2019.

The new web site is showing the error

HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.

As far as I can see the website on the new server is configured the same as on the existing.

Neither have directory Browsing enabled nor a default file set as is recommended by most of the posts which exist discussing this error.

I have run the following which is also recommended.

%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -ir

The problem still exists.

I came across a post saying there might be an issue if paths referenced in the web.config are not correct but they look fine.

Has anyone got any insight into what else might cause this issue?

Are there any differences between IIS 8.5 and IIS 10 or between windows servers 2012 and 2019 which might cause this issue?

Thanks

CodePudding user response:

All those clowns glibly posting that "HTTP Error 403.14 - Forbidden: The Web server is configured to not list the contents of this directory" can be fixed by configuring the web site by either enabling the Directory Browsing feature or adding a default document are really not understanding what they are talking about. Anyone can copy a solution from one post and paste to another.

I'm not going to pretend I know what I am talking about but I have fixed my issue and will share what I did here to see in the hope it helps others.

I created a project (of the same type as the application I was trying to deploy) using my IDE (MSVS) in the same .Net version of the application I was trying to deploy. In this case it was creation of an MVC project in .Net Framework 4.5.

I did nothing to it. All I wanted was a skeleton.

I replaced all the files in the home directory of the web site I had an issue with, with the files of this skeleton project.

I attempted to browse to the web site and it worked successfully. Note the directory browsing was not enabled nor was a default directory set.

This proved to me that those settings were irrelevant.

Having googled around, some sites point to paths in config files causing an issue if they do not exist, eg a logging path to d:\logs where that directory was missing. It didn't fix my issue but there's no harm checking.

I stumbled across a post which talked about the roles and features enabled on the server. In Web Server (IIS)/Web Server/Application Development they had selected "Application Initialisation" and "ASP".

The Windows Sever 2012 server I was moving the application from, where it work without a hitch, did not have those selected so had not selected them on the Windows Server 2019 I was moving them to when I set that server up.

It made no sense that this would be the solution but having tried everything else I activated those two options. Stone me if the issue was resolved.

As a check I removed those two options and the problem came back and when I reselected them it went away again.

This struck me as pretty conclusive.

It seems there is something about the application I am attempting to deploy which requires this in Windows Server 2019 but I have no idea what that might be. If anyone has any suggestions, I would be pleased to hear them.

All those muppets robotically posting advice on configuring the web site by either enabling the Directory Browsing feature or adding a default document will no doubt copy this and paste it into their posts to claim the credit but c'est la vie.

I hope this post is of use to someone, apart from those muppets.

CodePudding user response:

This problem occurs because the website doesn't have the Directory Browsing feature enabled. Also, the default document isn't configured. To resolve this problem, use one of the following methods:

Method 1: Enable the Directory Browsing feature in IIS

To resolve this problem, follow these steps:

  1. Start IIS Manager. To do it, select Start, select Run, type inetmgr.exe, and then select OK.
  2. In IIS Manager, expand server name, expand Web sites, and then select the website that you want to change.
  3. In the Features view, double-click Directory Browsing.
  4. In the Actions pane, select Enable.

Method 2: Add a default document

To resolve this problem, follow these steps:

  1. Start IIS Manager. To do it, select Start, select Run, type inetmgr.exe, and then select OK.
  2. In IIS Manager, expand server name, expand Web sites, and then select the website that you want to change.
  3. In the Features view, double-click Default Document.
  4. In the Actions pane, select Enable.
  5. In the File Name box, type the name of the default document, and then select OK.

More information you can refer to this link: HTTP Error 403.14 - Forbidden when you open an IIS webpage.

  • Related