• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Apache error message

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

ArBiTaL 24

There is no spoon
Joined
Aug 17, 2002
Hi,
I'm running an apache server, and i'm trying to figure out where the default error messages are (for example, when you the wrong link, it's say "not found"... "blah/blah was not found on this server", etc)... What directory are they stored in? It looked like Apache/error, but i opened those files in IE and it's some other kind of script....

Thanks :)
 
They are stored in the log file. Example:
Code:
80.42.65.241 - - [01/Feb/2004:02:55:18 +0000] "GET /flash/EuropeItaly.swf HTTP/1.1" [COLOR=red]200[/COLOR] 1994655
141.219.81.32 - - [03/Feb/2004:23:44:10 +0000] "GET /favicon.ico HTTP/1.1" [COLOR=red]404[/COLOR] 20

(IP) - - (time) (order) (status) (data sent)

The status codes (in red) are the "answer" you get. 200 is "The request has succeeded." 404 is "not Found".

http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

If you want a quick and easy way to analyse your log file try this:

http://cjwinnit.hopto.org/analog.zip

Unzip it to wherever you want and edit the "analog.cfg" file

Where you see this:

LOGFILE "C:\Program Files\Apache Group\Apache2\logs\cjwinnit.hopto.org.log"
HOSTNAME "Joseph's Site"

Change to be relevant.

once you run it read the "index.html" file it makes.
 
Last edited:
i dont think he meant the logging for them. try making a file named missing.html in your base directory that is visible to the internet. you can also set which files to use in httpd.conf, but this is probably easiest.
 
I'm not really sure, what I mean is i'm trying to find the HTML file that Apache shows when an error comes up. For example, you you had "www.blah.com" and you went to "www.blah.com/blahblah" and there was no such directory as blahblah, assuming it's running Apache, you get that error. I'm trying to find the HTML file so I can customise it (some sites you see have custom 404 errors)

gusgizmo - so that'd be the file it would link to in a 404? Would that be actual base directory (C:), or base of apache (c:\ program files\apache2) for me.. or HTdocs?
 
If you do exactly what Smokeys says, you'll need to stick it in the root directory for your site (right alongside of index.html)

If you check out the httpd.conf file, you'll find there's several ways to make error messages appear. You can serve plain text that you specify in httpd.conf (#1), a file on your site the path and filename of which you specify (#2), some kind of script (#4), or a document elsewhere on the web (#4).

#1 - ErrorDocument 404 "The file was not found."
#2 - ErrorDocument 404 /missing.html
#3 - ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#4 - ErrorDocument 404 http://www.example.com/errors/404.html

JigPu
 
Aaah, I was thinking how do you find the log for it. Apologies, I had just woke up and didn't read it correctly.

Incidentally, if you use vhosts, each VirtualHost can have it's own ErrorDocument setting.
 
I hate to be a pain re-bumping this, but I tried and it didn't work >_<

I made a file called "missing.html", and put it in HTdocs. I then edited httpd.conf, like so:

ugh.jpg

,removing the leading "#" so that it may act as a line of code. However, when I open a page which doesn't exist on my website, like this:
Linky
,as you can see, it just comes up with the standard Apache error. What have I done wrong?

Thankies :)
 
Last edited:
Back