IIS 8.5 is not serving JS, CSS, and Image files (static content)

霸气de小男生 提交于 2019-11-30 23:02:24

问题


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:

  • IIS 7.5 no images css js showing
  • IIS 7.5 no images css js showing
  • The official Orchard deployment documentation

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

The task manager confirms that the site is running as the orchard user.

The security properties of the ..\Themes\SafeMode\Styles\ directory gives Read permission to orchard.

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


回答1:


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.

.

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




回答2:


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




回答3:


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




回答4:


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....




回答5:


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



来源:https://stackoverflow.com/questions/28400717/iis-8-5-is-not-serving-js-css-and-image-files-static-content

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!