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

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.

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 is 404 working when comment disabled

In my httpd.conf file, every mention of the ErrorDocument has a hash before it on the same line - meaning that it's commented out.
So why do I get a 404 error page on the browser? How does the browser know what message to display?
I must be getting a 404 because this is displayed in the error_log;
[Wed Jun 25 12:21:17 2014] [error] [client **********] File does not exist: /var/www/html/surveys/blahblah
Is there a default setting somewhere?
My environment is Linux, Apache and PHP
You see Apache httpd's simple hardcoded message.
You need to configure an empty document as the ErrorDocument if you want a empty page to be displayed.
See the Apache Documentation or this question for further informations.

500 Internal Server Error when adding .htaccess file on root of MAMP

I'm getting a 500 Internal Server Error when I add an .htaccess file to the root of my site on MAMP. I have a virtual host set up, so the site is accessable through site.dev and my files live in /Users/Dan/Websites/site. There isn't any .htaccess files above the my current directory. At first, I thought it was something going on inside of my file, but I removed everything except for a commented line and the error is still there. When I have a blank file, the error goes away.
Update: Here's the error log
[Mon Apr 01 11:17:18 2013] [alert] [client 127.0.0.1] /Users/Dan/Websites/site/.htaccess: Invalid command '\xff\xfe#', perhaps misspelled or defined by a module not included in the server configuration
Any ideas?
\xff\xfe is the byte-order marker (BOM) for UTF-16. There's nothing wrong with that but Apache doesn't seem to support BOMs at all. So you'll need to save your .htaccess file with a different encoding, either a single-byte one or UTF-8 without BOM.

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.

Apache error log - file does not exist

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.