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.

favicon.ico File does not exist errors in apache log

Discussion in 'Workarounds and Optimization' started by craigedmonds, Mar 13, 2012.

  1. craigedmonds

    craigedmonds Well-Known Member

    Joined:
    Oct 29, 2007
    Messages:
    107
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Europe
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hi All,

    Is there a way for me periodically scan the apache log and if the error for favicon.ico not found comes up, simply copy a default one to the users folder?

    I get ALOT of these messages in the log (thousands per day)

    Code:
    File does not exist: /home/username/public_html/domain.ccc/favicon.ico
    File does not exist: /home/username/public_html/domain.ccc/404.shtml
    File does not exist: /home/username/public_html/domain.ccc/robots.txt
    
    It would be nice to find a elegant way to fix these errors.

    Alternatively, perhaps some way of turning these notification OFF in the apache logs. (less loggin = less cpu usage)
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,480
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    I'm not aware of any way to handle this automagically, I do think this might make a nice Feature Request though.

    Adding these files to the cpanel3-skel for root and Reseller(s) is a great way to start out and limit these errors. For many years I've added the most common error pages (400.shtml, 401.shtml, 403.shtml and others, favicon, index.html landing page, robots.txt) and a readme to explain to the new user what they are, why they are here, and how to edit the error pages (via cPanel) and this has worked well.

    Users create sub domains / addon domains and the errors start rolling back in anyway though. There's help on the way for that, see this Feature Request:
    skeleton directory for addon and sub domains

    But, if you've got for example one hundred accounts you've just moved in from somewhere else and those accounts are all lacking these most accessed files, like a simple favicon, 404.shtml or robots.txt you can expect to see lots of the errors you provide an example of, filling logs in a big way. So...

    I agree with this comment. I wonder if others might as well?
     
    #2 Infopro, Mar 13, 2012
    Last edited: Mar 20, 2015
  3. Eric

    Eric Administrator
    Staff Member

    Joined:
    Nov 25, 2007
    Messages:
    746
    Likes Received:
    11
    Trophy Points:
    18
    Location:
    Texas
    cPanel Access Level:
    Root Administrator
    Howdy,

    If you want to troll the error log from time to time this bash bit might help.

    Code:
    cat /usr/local/apache/logs/error_log |grep "File does not exist"| awk '{print $13}'|sort|uniq|grep favicon.ico
    
    You can also change out favicon for any other file you're looking for.
     

Share This Page