Shattuck Shattuck - 1 year ago 66
ASP.NET (C#) Question

IIS7 403 - Access Denied

I am trying to deploy a website that I have built in mvc3 on an server that runs iis7. I was able to get it running through the iis7 locally on my laptop, but when I try to put it on the server I get a 403 access denied error when trying to get to it remotely and a "connection has timed out" when I try to view it from the server itself.

I have made sure I have the most recent .Net 4 framework using the asp_regiis.exe. I tried multiple application pools including the default. I allowed .net4 isapi. I have changed permission to allow access from IUSER, SERVER NETWORK, Authenticated Users. I have made sure the default document list is the same as the one on my laptop iis7 (which works fine).

I also have multiple other sites (using webforms, not mvc) working just fine on the server.

Could it have something to do with the way I passed to files to the server? I just zipped the files up and placed them (and unzipped them) on the server and directed iis to the created directory.

What am I missing?

Answer Source

I faced this error last week and it can be caused by many things:

  1. The right version of the .NET framework is not installed or registered with asp_regiis.exe
  2. The "runAllManagedModulesForAllRequests" is set to false in your web.config
  3. The right version of MVC is not installed in the server
  4. You have an ignore route which ignores your request
  5. You have an early exception in your Application_Start and your site doesn't start properly

For my part I forget to changed my logging directory path value in the web.config to an existing directoy.

What you can do to know if it's an configuration error or an error in your application is to create a new default MVC project in VS and to deploy it in the same apppool.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download