views:

313

answers:

2

Hello everyone,

I am using VSTS 2008 + C# + .Net 3.5 + IIS 7.0. I have created a new web site and put an html file into the directory. And when I use browse function in IIS manager to browse the html file, I met with the following error, any ideas what is wrong?

BTW: I am very confused about unauthorized error since I run the worker process under administrator account. From the error message, I am confused why the logon method is anonymous and not using administrator account?

HTTP Error 401.3 - Unauthorized
You do not have permission to view this directory or page because of the access control list (ACL) configuration or encryption settings for this resource on the Web server.

Module IIS Web Core 
Notification AuthenticateRequest 
Handler StaticFile 
Error Code 0x80070005 
Requested URL http://localhost:80/a.html 
Physical Path C:\test\simplehosttest\a.html 
Logon Method Anonymous 
Logon User Anonymous

thanks in advance, George

+2  A: 

C:\test\simplehosttest\a.html

Please grant IUSR account necessary rights on this file or its folder. Then 401.3 error will disappear.

Lex Li
I have already set the account for worker process to be administrator, why still has permission issue? Administrator should be more powerful than IUSR?
George2
I have tried to add IUSR and it works, cool! Why using IUSR could solve my issue? This special user is used for?
George2
IUSR is used as the default anonymous user account. That means when your site is anonymous accessible, in fact IIS uses IUSR account as the logon account for all users. Then you must grant IUSR necessary permissions on the folders so it can access them.
Lex Li
http://learn.iis.net/page.aspx/140/understanding-the-built-in-user-and-group-accounts-in-iis-70/
Lex Li
Thanks, question answered!
George2
+1  A: 

Basically you have to grant read access to the file to the identity that runs your apppool in IIS. On 2008 server and Vista that identity (unless you have explicitly changed it) would be "NT Authority\Network Service" and on windows7 it's "IisAppPool\AppPoolIdentity" (and don't ask why they have done that on win7, it's a WTF if you ask me)

klausbyskov
I am confused, there is a user name called "AppPoolIdentity"?
George2
I have tried to add html page permission to user "IUSR", and it works. Why using IUSR could solve my issue? This special user is used for?
George2
Thanks, "WTF" means?
George2
Well, WTF is here http://en.wikipedia.org/wiki/Wtf :)
Lex Li