I'm running Apache, CentOS 5.5, cPanel.
I want to block the error_log files from being accessed from the web, as it shows errors that might give away data that I don't want given away.
How can I do this?
closed as off-topic by Jenny D, Ladadadada, Scott Pack, Iain, Michael Hampton♦ Jun 28 '13 at 20:09
The answer to this is your server error_log file is not stored in the same directory tree as your webserver content files. For example, your webserver typically serves files from somewhere like
EDIT: responding to comment that logs may be accessible for the webserver to send to clients. In reviewing httpd.conf, this is certainly technically possible. If your DocumentRoot and ServerRoot point to the same filesystem tree, I suppose that you could end up being able to serve error_log to clients. Also if you use an absolute path for ErrorLog you could place it in under your DocumentRoot and again make it accessible to clients.
In either of those cases, you could then protect your error_log with a .htaccess file in the same directory, with contents like this:
then any client that requested that file woud be denied.