文件存在的 IIS 404 错误

Ian*_*ley 17 iis iis-7.5 http-status-code-404

我从我的供应商那里安装了全新的 VPS(Windows 2008 R2、IIS 7.5)。

默认网站工作正常:http://5.9.251.167/
我创建了一个新网站,并绑定到http://new.ianquigley.com
在该服务器上以及域映射到 IP 地址的其他任何地方。(例如 ping new.ianquigley.com)。

我创建了子文件夹c:\inetpub\wwwroot\com.ianquigley并创建了一个index.html内容为“ <html>cake</html>”的 HTML 文件

该网站的默认文档是 index.html

在服务器上,在 Chrome 中,我浏览到http://new.ianquigley.com/index.html并收到 404 错误。

该页面说;

HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had it's name changed, 
or is temporarily unavailable.

Detail:
Module: IIS Web Core
Notification: HttpRequestHandler
Handler: StaticFile
Error Code: 0x80007002
Request URL: http://new.ianquigley.com/index.html
Physical path: c:\inetpub\wwwroot\com.ianquigley\index.html
Logon Method: Anonymous
Logon User: Anonymous
Failed Request Log: c:\inetpub\logs\FailedRequestLog
Run Code Online (Sandbox Code Playgroud)

物理路径确实存在。该文件夹wwwrootcom.ianquigley两者都具有“所有人”和“读取”权限。

c:\inetpub\wwwroot\logfiles\w3svc2\u_ex130201文件包含对带有 404 错误代码的 index.html 的请求。

更新(来自下面的评论)
c:\cake使用“所有人”“完全控制”权限创建。将我的 index.html 文件移到那里并更改了 IIS 中的映射。再次在服务器上的浏览器中检查页面给了我与上面相同的结果,除了物理路径是c:\cake\index.html

更新 2 默认网站(工作正常/可以从磁盘读取)在“DefaultAppPool”中运行,它最初使用帐户“ApplicationPoolIdentity”。新网站也使用相同的应用程序池。我试过将帐户更改为;NetworkService、LocalService 和 LocalSytem(每次都刷新应用程序池)……仍然没有乐趣!

W3SVC2 日志

#Software: Microsoft Internet Information Services 7.5
#Version: 1.0
#Date: 2013-02-02 20:00:02
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status time-taken
2013-02-02 20:00:02 5.9.251.167 GET /index.html - 80 - 5.9.251.167 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.17+(KHTML,+like+Gecko)+Chrome/24.0.1312.57+Safari/537.17 404 0 2 1151
Run Code Online (Sandbox Code Playgroud)

sc-win32-status: 2意思是“找不到文件”。所以这可能只是一个文件访问权限问题。如果是,为什么默认网站可以成功从c:\inetpub\wwwroot文件夹中读取但没有权限的子文件夹。

现在我完全被难住了。

Ian*_*ley 30

面掌

新的 VPS 框,意味着默认行为。即“隐藏已知类型的文件类型扩展名”。当我关闭它时,我发现我的文件实际上名为index.html.txt. 将其重命名为index.html并解决了问题。

  • 为什么服务器操作系统(唯一真正的受众是服务器管理员人群)为您禁用文件扩展名显示,就像您是计算机文盲一样?哦微软... (25认同)