Apache error log - file does not exist - apache

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.

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.

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.

I had this same issue in this scenario:
wamp installation
system was running perfectly til dec 01/2010.
restarted computer on dec 02/2010.
apache wouldn't start up and was logging [Thu Dec 02 09:15:45 2010] [error] [client 127.0.0.1] File does not exist: C:/wamp/www/announce
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. =)

One of my clients had a similar issue with Apache on Windows.
On any request he was getting:
[error] [client 192.168.1.66] File does not exist: D:/apache
I realized that the DocumentRoot was missing form the httpd.conf.

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:
[Mon May 06 21:47:29 2013] [error] [client ip] File does not exist: /path/, referer: http://domain/example.html
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.

Related

No permissions on htaccess file

I'm trying to setup a vagrant box with a lamp stack and was mostly successful. However, now I'm stuck with the error "Server unable to read .htaccess file". My setup is a Centos 7 server with Apache 2.4 and PHP 5.6.
Apparently, this seems to happen a lot as I saw many people ask that question, but here's the thing:
1) All my folders are with 777 permissions
2) AllowOverride all and Require all granted is set on all of my folders
3) Even went so far as to add apache user to root group just to see if it would change something
I basically did everything that was suggested in all of the posts I saw and still, apache can't read the .htaccess file.
In my logs, I see:
[Tue Sep 26 15:20:18.178541 2017] [core:crit] [pid 6491:tid 139938095892224] (13)Permission denied: [client 10.0.2.15:52176] AH00529: /var/www/html/Kalendho/public/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/var/www/html/Kalendho/public/' is executable
So I presume apache actually find the file, but for some reason, cannot open it even though it should be able to. So really, any help would be greatly appreciated as I'm currently at my whit's end here.
Thanks in advance
Okay, so apparently, it was an issue with selinux. Here's what I did:
Opened the file /etc/selinux/config and changed the following line:
SELINUX=enforcing
to
SELINUX=disabled
After that, I rebooted my machine and it got rid of the htaccess error.

Why isn't apache serving the page? mod_rewrite seems to have found the right file

The project I'm working on has a fairly long & complicated list of RewriteRules, separated into 2 .htaccess files for legacy reasons. I'm putting the app into a Docker container to make it easier to on-board new developers, but the Ubuntu/Apache combo is choking on the RewriteRules and giving me an HTTP 500.
Docker image: php:5.6-Apache
Apache Version: 2.4
I boosted the logging to trace4 and it appears to figure out the right file - here's the last line of the mod_rewrite debug output
[Thu Mar 16 09:08:15.459987 2017] [rewrite:trace1] [pid 17] mod_rewrite.c(475): [client 192.168.99.1:63990] 192.168.99.1 - - [rs.dev/sid#7f51cf6fece0][rid#7f51cf61c8f8/initial/redir#3] [perdir /var/www/appname/public_html/production/] pass through /var/www/appname/public_html/production/login.php
The file '/var/www/appname/public_html/production/login.php' exists, and is the file that should be loaded. However, the response is sent as a 500, (and the page doesn't load). I'm using the /login URL here as an example, but it happens on all URLs.
This works on the localhost of a Mac running macOS, and it works in cPanel servers, I just can't seem to get it running in the Ubuntu base that Docker's providing me.
Does anyone know why Apache would use mod_rewrite and appear to identify the correct file, but then not use the file?
For reference, the entire log output from the request is on pastebin.
It turns out that my problem wasn't in the Rewriting at all, I had forgotten to create a file that PHP was trying to require, so it was throwing a PHP error. However, the way the logs were configured, the error was disappearing into the ether, (or into a log I haven't found yet).
Let that be a lesson - even if you're absolutely sure where the error is, you might still be wrong!

Apache - File does not exist error (file is definitely there) - favicon.ico

I have apache set up as a LAMP server in Linux
In the root /www/ directory, I have a favicon.ico but it never shows in the browser (Chromium, Firefox) and in the apache error.log I get the following error:
[Mon Jul 08 17:32:30 2013] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
I'm not especially bothered with the file not appearing but it is there and I haven't been able to figure out why it's giving me this error.
(Answered in a question edit. Converted to a community wiki answer. See Question with no answers, but issue solved in the comments (or extended in chat) )
The OP wrote:
The favicon was 32x32 which seems to be why. I substituted with a 16x16 favicon.ico file and I no longer get this error.
What I further don't understand is why I would get this at all - presumably some setting as I have an apache server on a hosted website with the same 32x32 favicon but it appears there and there are no errors.

What can I fix to avoid this error in apache error log: "File does not exist: /www/site/[object Object]:,"?

I have many errors in my apache error log like this:
[Mon Mar 26 08:12:52 2012] [error] [client 92.xx.xxx.xxx] File does not exist: /www/site/[object Object]:, referer: http://site.com/
I can't figure out, what makes this error.
How can i fix this?
My Apache version is 2.2.9
Check to see if the files referenced in your logs are files that you think exist or should exist on your site. If the files are files that you think should be on your site, then you might have some incorrect links in some of you pages. You can use a web crawler to check this.
If the pages referred to in the messages are things like ".../cmd.exe" or other pages that are not and never were on your site, then these log entries probably represent probes from bots looking for known exploits in some versions of some web servers. There is not much you can do about this. Welcome to the Internet.
If the client address for many of the requests is the same over a period of an hour or more, you are best advised to block that particular IP address at your external firewall.

server configuration error

what does this address http://www.jasbf.com/ says i did not understand when i check my error log it says something like this
[Mon Jan 17 01:15:22 2011] [error] File does not exist: /public_html/favicon.ico
[Mon Jan 17 01:15:21 2011] [error] File does not exist: /public_html/404.shtml
This is Apache's DocumentRoot misconfiguration.
It is missing files or file permissions are wrong.
favicon.ico is the little image left of the url bar in firefox/internet explorer. Those (and many more) browsers are looking for this icon to display. That is where the upper error comes from.
In case a webserver cannot find a requested url; it needs to display an error. This particular error is also known on the web as a "404 (not found)" error. However; this is displayed as a regular html page. The 404.shtml is probably what the webbrowser wants to use as 404 page.