19

The problem

We're running IIS on Windows 8.1 with Update. We're at the Orchard CMS first time setup screen, and IIS is giving 401s for all static content. We have read the following to no avail:

Based on those, this is what I have tried that doesn't work.

  1. Turn on the IIS feature to Serve Static Content.
  2. Give IIS_IUSRS permission to Read, write & execute.
  3. Give the site's application pool permission to Read, write & execute.

What does work though is the nuclear option: to give Everyone the Read permission (unless we want to proceed with the Orchard setup; then we need to give Everyone even more permissions.) That leads me to believe that I must give permission to some principle with less scope than Everyone but more scope than both IIS_IUSRS and the application pool combined.

Who/what is that principle?

Pictures to show the problem

We receive a 401 on ..\Themes\SafeMode\Styles\site.css Themes\SafeMode\Styles\site.css has a 401

The task manager confirms that the site is running as the orchard user. The IIS website is running as the orchard app pool

The security properties of the ..\Themes\SafeMode\Styles\ directory gives Read permission to orchard. The orchard app pool has write permission not to mention read.

Why does it only work when we give Read permission to Everyone?

5
  • 1
    using NetworkService as the application pool's login might work for you (and set RW perms for that on the folder) Commented Feb 8, 2015 at 23:46
  • That didn't work. I set the orchard application pool's identity to NetworkService, gave Network Service RW permission on the folder, recycled the app pool, and restarted the website. I still get the same 401. Commented Feb 9, 2015 at 0:00
  • 1
    could you plz show authentication section from web.config and show us how is authentication configured in iis? Commented Feb 9, 2015 at 1:53
  • @PankajKapare There doesn't seem to be anything in the system.webServer section of the main web.config to cause a 401. Further, the system.web > authentication is just standard Forms auth and won't have anything to do with it. Commented Feb 9, 2015 at 3:18
  • @PankajKapare For the specific site, IIS has both Anonymous Authentication and Forms Authentication enabled and has ASP.NET Impersonation disabled. Commented Feb 9, 2015 at 3:20

6 Answers 6

37

I had a similar problem. Under authentication, I right clicked "Anonymous Authentication" and clicked "Edit". That shows a dialog giving you the ability to set the identity of the anonymous user. I set it to "Application pool identity" and that fixed the problem for me.

IIS Anonymous Authentication Credentials Dialog.

This may not be the most secure configuration though, but I'm on a dev server so I don't care.

Sign up to request clarification or add additional context in comments.

1 Comment

Well, I tried a lot of things and this answer is what worked also for me. Probably tied to anonymous users not being allowed to even read the files on disk because of lacking NTFS permissions. You might try to have Specific user still, but remember to add read permission for that specific user on NTFS permission to scope the amount of files the anonymous readers should be allowed to read.
11

Try turn on the Static Content and Directory Browsing features under Internet Information Services->World Wide Web Services->Common HTTP Features node.

1 Comment

this was my solution, but try to install "directory Browsing" as well. happy coding :)
3

In my case I had to set Read permission for IUSR user for the web site folder.

Comments

1

So, what I had to do to fix this problem was the following: (and please understand, that this is not ASP or PHP script related, the server wouldn't even show basic simple .html files, yet would serve out PHP results all day long!)

Two fold…

  1. Had to set the application pool for each site, under advanced settings, to use LocalSystem for it’s process
  2. Under site, advanced settings, security, add the IUSR account to have read & list contents access, for the site… :-)

See any problems with doing that?

'cuz it's working....

Comments

1

enter image description here

Updating windows feature for WWW services/Common Http Features/static content by selecting Static Content checkbox fixed my IIS not service static content issue.

Comments

0

Open IIS -> go to advanced settings of selected website and open Physical Path Credentials -> Select specific user and enter your local user credentials. Open below screenshot for further visualising the things: IIS Settings

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.