The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

ErrorDocument

Discussion in 'General Discussion' started by ozzieonline, Jan 15, 2013.

  1. ozzieonline

    ozzieonline Well-Known Member

    Joined:
    Dec 20, 2012
    Messages:
    126
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Hello,

    If a file is not found on my server, or when a forbidden request is made, this is logged in the Apache log. Apache will try to load the corresponding ErrorDocument... which is not in my root folder. I don't want to use custom error documents because eventually I will handle everything from within my framework.

    I would like to know how I can stop Apache from requesting ErrorDocuments so my log won't be filled with error messages.

    I found this file: /usr/local/apache/conf/includes/errordocument.conf

    It contains the locations to the error documents. If I empty this file will my problem be solved then? Or will the file be overwritten when Apache is updated? If this is not a good solution, is there a better one?
     
  2. quietFinn

    quietFinn Well-Known Member

    Joined:
    Feb 4, 2006
    Messages:
    998
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    You can edit the file /usr/local/apache/conf/includes/errordocument.conf
    and modify it like this:

    Code:
    ErrorDocument 403 "Sorry can't allow you access today" 
    
    meaning that instead of loading a file Apache is showing that message.

    If that file is overwritten by EasyApache you can do those changes in "Pre VirtualHost Include":
    Service Configuration-> Apache Configuration-> Include Editor-> Pre VirtualHost Include-> All versions.
     
  3. ozzieonline

    ozzieonline Well-Known Member

    Joined:
    Dec 20, 2012
    Messages:
    126
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Thanks quietFinn!! I will give that a try. I will use the include file then, just to be sure.
     

Share This Page