3

I am having this weird issue with IIS 7.5 on Windows 2008 R2 x64. I created a site in IIS and manually created a test file index.html and everything worked. When I try to do a deployment, I copy all the files from my local PC to the IIS server, try to access index.html (this is the proper deployed file) and getting 401.3 access denied error. I then try to manually recreate index.html and copy content into this newly created file and the page is accessible again... I just can't figure this out. So the issue is that IIS 7.5 can't server files that have been copied from other PCs. I tried to reset/apply permission settings to the copied folders/files but nothing has worked. Please help. Thanks! By the way, the files that I copied are just some html cutups i.e. generic html, css and image files, nothing special.

5 Answers 5

4

Sounds like a file permission issue to me. Make sure that you are indeed copying files into the wwwroot folder and not moving them from another folder. When you copy the files they will automatically inherit the permissions from the parent folder, but if you move files they will retain their original permissions. I would recommend first copying the files to a folder on the computer and then copying them from there into the wwwroot folder.

Another thing to try would be to zip the files before copying them to the computer and then extract them to the local drive before copying them into the wwwroot folder.

1

IIS 7.5 should have given you detailed error on where you have ACCESS DENIED. If that does not help, use Process Monitor and reproduce the error again and look for any ACCESS DENIED.

1

I was just struggling with this same issue. I'd deployed files to the IIS 7.5 server from another computer, and was getting 401 access denied errors. I tried adding the Application Domain Identity account (more on these here: http://stevesmithblog.com/blog/working-with-application-pool-identities/), the NETWORK SERVICE account, etc. and none of these worked.

What did work for me was adding the IUSR account to the web site's folder (recursively) with the default permissions (Read & execute, List folder contents, Read).

1

The problem not lies precisely in the authorization/authentication but in the modules that now manages the IIS. Inside system.webServer you should have runAllManagedModulesForAllRequests set to false so you can display all images/css without problems with authentication.

In ASP.NET websites, the value of runAllManagedModulesForAllRequests previously had to be set to true to support routing. However, once IIS 7 has been updated with a Service Pack, the value of runAllManagedModulesForAllRequests can be set to false or omitted when working with ASP.NET routing.

Ref. http://www.iis.net/configreference/system.webserver/modules

P.S. Don't forget to add the following lines to the AppSettings section of my web.config file:

<add key="autoFormsAuthentication" value="false"/>
<add key="enableSimpleMembership" value="false"/>
0

See my answer here. This IMO is a breaking change in Windows Server 2008 R2.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .