Why is 404 working when comment disabled - apache

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.

Related

How to make apache not to ignore ErrorDocument 404 with in ᴜʀʟ which contains a?

Note: the supposed duplicate is about how to access files with long names, but in my case, I don’t even want to check for it’s existence and have /_ah/conflogin/index.html.gz being used instead.
ErrorDocument 404 /_ah/conflogin/index.html.gz
Which when the document contains a ? and a long ᴜʀʟ after it results in a 403 error:
For example accessing /_ah/conflogin?state=~AJKiYcGTxysMayaAQSUXMAm3sKBrvlKLrR73oI_W8LXwAbHHy6M61MQ3SyI4md2Abg2Y_DWAlPPdH5nDKaB1Wafg3KKMltgR3WIcvkhV0aOlPbQ9TX21wOTXIcyhGPz4fCe6x_AT3XdIfDk2zqQ2mxCUW45qKhtNPFxG4SHzKg6sRuJPPF2o3QITLMZHbwS2yDQLaIuc298ROAUVu_3sgl0G9YZbM6K_mZEAqeI3zCX5MmG41eUfiX2wSxsSNPCLWQ24LAFuqOu4An9GqLYD4ycAh-EQKGG8P_2iKOYmkOcZytYeEF9I
triggers a HTTP 403 page with this error in the log:
[Sat Apr 13 17:26:29 2019] [error] (63)File name too long: access to /_ah/conflogin?state=~AJKiYcGTxysMayaAQSUXMAm3sKBrvlKLrR73oI_W8LXwAbHHy6M61MQ3SyI4md2Abg2Y_DWAlPPdH5nDKaB1Wafg3KKMltgR3WIcvkhV0aOlPbQ9TX21wOTXIcyhGPz4fCe6x_AT3XdIfDk2zqQ2mxCUW45qKhtNPFxG4SHzKg6sRuJPPF2o3QITLMZHbwS2yDQLaIuc298ROAUVu_3sgl0G9YZbM6K_mZEAqeI3zCX5MmG41eUfiX2wSxsSNPCLWQ24LAFuqOu4An9GqLYD4ycAh-EQKGG8P_2iKOYmkOcZytYeEF9I failed (filesystem path '/www/y/ytrezq/_ah/conflogin?state=~AJKiYcGTxysMayaAQSUXMAm3sKBrvlKLrR73oI_W8LXwAbHHy6M61MQ3SyI4md2Abg2Y_DWAlPPdH5nDKaB1Wafg3KKMltgR3WIcvkhV0aOlPbQ9TX21wOTXIcyhGPz4fCe6x_AT3XdIfDk2zqQ2mxCUW45qKhtNPFxG4SHzKg6sRuJPPF2o3QITLMZHbwS2yDQLaIuc298ROAUVu_3sgl0G9YZbM6K_mZEAqeI3zCX5MmG41eUfiX2wSxsSNPCLWQ24LAFuqOu4An9GqLYD4ycAh-EQKGG8P_2iKOYmkOcZytYeEF9I')
So how to make apache not ignore the ErrorDocument directive if the requested ᴜʀʟ is too long ?

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.

Error 404 display Issues

I need help with Error 404 Display of my website. When i enter a wrong URL i get a Error 500 display. If i change the URL to a page that i'm sure is in the root, i still get this same Error 500 display.
Please where could the problem come from.
Both the .htaccess file and the 404.php are in the same directory ( root )...
Below is the content of my .htaccess file
ErrorDocument 404/church/404.php
this is the error in the Apache Error File
[Sat Apr 28 9:10:04] [alert] [client 127. 0. 0.1] C:/wamp/www/church/. htaccess: ErrorDocument takes two arguments, Change responses for HTTP errors
thanks for the help.
You're missing a space: it should say ErrorDocument 404 /church/404.php. (Well, I can't absolutely guarantee that that will work because I don't know what you have in your filesystem, but that's definitely righter than what you have now.)

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.