0

I think it's because APC because I use only APC system for cache. Here is the full log:

 2013/04/23 19:15:05 [error] 539#0: *1305213 open() "/var/www/cache/e4ce8db565491cdcf27ab61a441xxxx" failed (2: No such file or directory), client: 2.83.130.yyy, server: zzz.com, request: "GET /cache/e4ce8db565491cdcf27ab61a441xxxx HTTP/1.1", host: "zzz.com", referrer: "http://zzz.com/aPHPfile"

configuration : nginx, php5-fpm

xecute
  • 111
  • 1
  • 9

2 Answers2

3

This message comes from nginx — apparently it decided to serve the request by returning a static file, but that file is not present. The cache in question is on the PHP application level, because the request URL path starts with /cache/ — it is not some kind of internal cache in nginx or APC.

Possible causes:

  1. Maybe the request should have been passed to a PHP script, but the location/rewrite rules in nginx are not correct for your PHP framework/CMS.

  2. Maybe the cache file in question should have been created by the PHP code when handling the previous request (e.g., the obscured URL in referer), but could not be created, e.g., due to permissions of the /var/www/cache directory. In this case you should see some errors in php-fpm logs (if the PHP code does not blindly ignore them).

Giving a more precise answer is impossible, because there is no information about the used PHP framework, CMS or application.

Sergey Vlasov
  • 6,288
  • 1
  • 21
  • 30
  • No framework or CMS used to build application. Also there is no cache directory or location/rewrite rule for that directory. – xecute May 03 '13 at 13:58
  • Sergey is absolutely correct. Try going to the referer page with a browser that supports request tracing (e.g. using a "developer console", Firebug, etc.). With that, look for a request to this "cache" directory. It's coming from somewhere. Failing that, it might be someone trying to hack the site and simply spoofing the Referer header in the course of looking for a specially-named file. You didn't mention if this message appears often and from diverse clients; if not, that might lead you to such a conclusion. – BMDan May 03 '13 at 16:00
  • @BMDan I tested so many times but it never requested cache file. Also it appears often and from diverse clients.. :\ – xecute May 04 '13 at 15:51
  • Is your web server root directory configured as /var/www/ ? If yes - everything is fine with nginx. According to log (GET request), something is requesting files from /cache/, there is misconfiguration with your web server and it's application asking the client to get file from that dir which is unreachable or it's just wrong request (call it whatever you want - attack, web application misconfiguration etc). – GioMac May 05 '13 at 03:16
  • I hate to say it, but at this point, you're probably looking at `grep`ing across the PHP files, and dump of any relevant database(s), looking for e4ce8db565491cdcf27ab61a441xxxx, or failing that, for "cache". This will be ugly, but if you can't reliably reproduce the issue, you have little other choice. Are you sure there's nothing in common amongst the clients hitting this issue (e.g. same User-Agent)? – BMDan May 07 '13 at 14:18
3

The error message says No such file or directory. And you say that the directory doesn't exist. So create the directory.

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972