404 messages are not recorded

6 posts / 0 new
Last post
#1 Sun, 03/13/2011 - 18:49
marciano

404 messages are not recorded

Hello all,

I have a custom 404.php file In Error Handling I've set 404 - Go to URL /404.php

If I go to www.mysite.com/ggg.php 404.php is displayed correctly because that file doesn't exist but the url remains ggg.php and no error log is recorded

How can I fix this?

Thank you

Sun, 03/13/2011 - 19:51
Locutus

I just tested this, checked the Apache docs and experimented a bit.

When you use a full URL (http://yourdomain.com/404.php) instead of a relative URL path, the browser will display the new URL.

About the error log: you might want to double-check that... For me, errors are logged just fine in the log, even though an error document is configured. Make sure to check Apache's error log, not the access one, and make sure to check the correct domain.

Mon, 03/14/2011 - 06:43 (Reply to #2)
marciano

Hi Locutus,

Absolutely sure I am checking the correct domain.
I changed to full url and it is changed if a wrong file is requested.

ErrorLog /var/log/virtualmin/mysite.com_error_log
CustomLog /var/log/virtualmin/mysite.com_access_log combined

I do get error messages from tail -f, for example, when I restarted apache to apply last change.
Access log displays requested images when 404.php is loaded.

Most error msgs are like
[Sun Mar 13 21:12:34 2011] [warn] (103)Software caused connection abort: mod_fcgid: ap_pass_brigade failed in handle_request function
I know are because of user stoping the page load.

Thank you
PS: Some exceed script time execution are also recorded sometimes
PS2: I guess read error log from Virtualmin panel uses tail -f It displays the same as terminal window
PS3: Browsing for a non existant jpg file, the error is recorded. Same for an html file or whatever without php extension
Something in php.ini?

Wed, 03/16/2011 - 05:48
Locutus

It should have nothing to do with PHP, since the "page not found" error occurs before any PHP (which is your error document page) is executed.

Currently I'm out of ideas unfortunately why the errors aren't logged for you. As I said, here during my test they were.

Wed, 03/16/2011 - 07:46
marciano

I am intrigued about this. Anything after domain name work as expected but .php file extensions I guess I have to dig httpd.conf

Thu, 03/17/2011 - 05:30
Locutus

Hmmm.. Okay yes, I tested it with an HTML file, not a PHP. It's possible that by using the PHP handler, things work slightly differently.

Maybe, if you used an HTML file as your error document which in turn contains a directive to again redirect the browser (I'm quite positive you can do that in the header of the HTML), it might both log the error and then fetch your PHP file.

Topic locked