Skip to main content

How to limit access to error_log

Comments

4 comments

  • Dave Smith
    You could comment out the below in your httpd config: ErrorLog "logs/error_log" And replace with: #ErrorLog "logs/error_log" Then restart Apache. Or add the following to your .htaccess files: php_flag log_errors Off
    0
  • cPanelMichael
    Hello @moyo, You could setup an include that applies to all Virtual Hosts on the system and utilize the Apache files directive to block public access to files named "error_log". EX: 1. Run the following command to create the include that applies to all virtual hosts (SSL and non-SSL):
    touch /etc/apache2/conf.d/userdata/denyerrorlog.conf
    2. Save the following lines to this file:
    Require all denied
    3. Rebuild the Apache configuration file:
    /scripts/rebuildhttpdconf
    Thank you.
    0
  • moyo
    Dear Dave Smith and cPanelMichael Thank you very much for your replies. Unfortunately the problem is still available and people can access to our error logs. I want to do something like this: - Link to error page removed - no one can access to this URL from outside. How can we do this? Best Regards
    0
  • cPanelMichael
    I want to do something like this: - Link to error page removed - no one can access to this URL from outside.

    Could you let us know the steps we can take to reproduce the issue after you implemented the workaround referenced in my last response? Thanks!
    0

Please sign in to leave a comment.