Apache错误日志-文件不存在
我的 apache 错误日志中收到一些神秘错误。 例如:
File does not exist: /home/httpd/vhosts/studentlife.co.il/httpdocs/help_center/div.hot-jobs
File does not exist: /home/httpd/vhosts/studentlife.co.il/httpdocs/solutions/function.filesize
File does not exist: /home/httpd/vhosts/studentlife.co.il/httpdocs/work_abroad/div.publish
现在我不明白——我的div和函数怎么突然变成了文件? 当然它们并不存在,它们是写在代码中的div和函数。 所以我不确定为什么会收到这些文件不存在错误。
另外,我如何调试这个,因为我在任何地方都没有尝试访问具有这些名称的文件?
任何见解都会很棒。
I am receiving some mysterious errors in my apache error log.
For example:
File does not exist: /home/httpd/vhosts/studentlife.co.il/httpdocs/help_center/div.hot-jobs
File does not exist: /home/httpd/vhosts/studentlife.co.il/httpdocs/solutions/function.filesize
File does not exist: /home/httpd/vhosts/studentlife.co.il/httpdocs/work_abroad/div.publish
Now I don't understand - how did my divs and functions suddenly turn into files?? Of course they do not exist, they are divs and functions written in the code. So I am not sure why I am getting these file does not exist errors.
Also, how can I debug this, since in no place am I trying to access files with these names?
Any insight will be great.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我想说不用担心。
我可以请求
/the/answer/to/life/the/universe/and/everything.42
,它会显示在您的错误日志中。可能某些蜘蛛正在寻找您网站中的漏洞,并且它会随机尝试 URL。 如果您多次看到相同的页面,请开始检查是否有任何损坏的链接,否则就忘记它。
I would say don't worry about it.
I can make a request for
/the/answer/to/life/the/universe/and/everything.42
and it would show up in your error log.Probably some spider is hunting for vulnerabilities in your site and it's randomly trying URLs. If you see the same pages a lot then start checking to see whether you have any broken links, otherwise forget about it.
您可以使用 FireBug 查看返回代码(您正在寻找 404)当您打开网站时发出的所有 HTTP 请求。 也许您的 HTML 中有一些拼写错误。
You could use FireBug to see the return codes (you are looking for 404) of all HTTP requests made when you open your website. Maybe you have some typo in your HTML.
在这种情况下,我遇到了同样的问题:
然后,只有那时,我提醒自己我刚刚在 2010 年 12 月 1 日安装了 SKYPE,在 Windows 上,我们在电话程序和 apache 之间争夺端口 80 时遇到了冲突,我猜。
关闭 Skype,重新启动服务,瞧:我的系统又回来了。 =)
I had this same issue in this scenario:
then, only then, I reminded myself I had just installed SKYPE on dec 01/2010 and that, on windows, we've got this conflict between the phone program and apache fighting for the port 80, I guess.
closed Skype, restarted services and voi là: my system is back. =)
我的一位客户在 Windows 上使用 Apache 时也遇到了类似的问题。
对于他收到的任何请求:
我意识到
httpd.conf
中缺少DocumentRoot
。One of my clients had a similar issue with Apache on Windows.
On any request he was getting:
I realized that the
DocumentRoot
was missing form thehttpd.conf
.我同意 Gareth 的观点,蜘蛛可能正在寻找您网站中的漏洞,并且它会随机尝试 URL。 然而,可能还有另一个原因,而且可能性更大。
在调试我自己的脚本以查看发生了什么之后,我注意到以下内容。 形式的错误:
在错误日志中可见,尽管听起来很奇怪,但它与生成页面的静态 HTML 文件或脚本无关。 事实上,这个问题的根源可能是页面的 HTML 引用了指向 image/css/js 文件的损坏链接,因此当浏览器收到 HTML 并获取这些资源时,Apache 无法找到它们并打印“文件不存在”错误。
Apache 很好,因为它会警告我们有关损坏的链接。
I agree with Gareth, a spider could be hunting for vulnerabilities in your site and it's randomly trying URLs. However, there may be another reason, probably more likely.
After debugging my own scripts to see what was going on, I noticed the following. The error of the form:
is visible in the error log and even though it will sound weird, it does not have to do with the static HTML file or script that generates the page. In fact, the source of this problem may be the HTML of the page referencing a broken link to an image/css/js file, so that when the browser receives the HTML and fetches these resources Apache can't find them and prints the "File Does Not Exist" error.
It is nice of Apache as it warns us about broken links.