Mobile app version of vmapp.org
Login or Join
Annie201

: Apache: keep track of non-404 errors (e.g., 403, 500, et al) In cpanel I always have the error log open ("This function will display the last 300 errors for your site.") which is nice for

@Annie201

Posted in: #Htaccess #Php

In cpanel I always have the error log open ("This function will display the last 300 errors for your site.") which is nice for 404's but what about the rest?

I'm working on a few things in htaccess, such as this:

RedirectMatch 403 /($|*)/?$


So now when I try any URL with a dollar-sign or an asterisk in it, bam, 403 forbidden; perfect.

So I refresh cpanel's error log page, and nothing. It seems to only care about 404's.

Incidentally, httpd.conf, which I cannot alter, is setup this way:

CustomLog "logs/access_log" common


The errors I'd like to know how to monitor are: 400, 401, 403, and 500.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Annie201

1 Comments

Sorted by latest first Latest Oldest Best

 

@Heady270

The Apache error log does track errors other than 404 errors. In the case of 500 errors, it shows you any error output from your scripts. cPanel must be hiding this information from you.

I usually filter the access logs to see a single line for each error page that occurs. I tend to use the command line to tail and filter it like this:

tail -F /var/log/apache2/access_log | grep -E '" (404|403|500) '

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme