Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Jul 2007
    Location
    Greece
    Posts
    52
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default Apache error_log "optimization"

    Not very often but from time to time I check the error_log
    of apache in /usr/local/apache/logs.

    In about 3-4 months the log is just HUGE.
    (Output from a live production server
    # cat error_log | wc -l
    597663

    Ok, 597663 lines log... Let's analyze it a little more:

    # grep "robots.txt" error_log | wc -l
    39311

    # grep "404" error_log | wc -l
    250740

    # grep "favico" error_log | wc -l
    29470

    So, 39311+250740+29470=319521 lines of errors in error_log
    from 597663 totally.

    So there are 278142 error lines needed, or let's say error lines that needs
    investigation from 597663 totally.


    These error I greped is all for not existent error pages (404), robots.txt and favicon.ico that trey are not exists in every user that doesnt know anything about this. Or just they dont have/care about a robots.txt or a 404 page.


    So, I was wondering if there is a "Cpanel" Friendly way or a script to create
    those pages or just copy from a "template" to users directories but WITHOUT harming pages of users that already done that.

    If I do this with a cp (copy) script in a cronjob I will get a
    cp: overwrite message at the 1st user who already has a file of these.
    If I do this with a cp -fr, it will overwrite all existing files
    Inspecting everones directory is an option but a hardcore one if you have
    100/200/300+ users.

    Anyone has a script for doing this or a tip how to do it without the risk
    of altering/deleting existing 404/robots/favicon files ?

    This should reduce the "errors" in apache error_log and we can have a
    more reasonable log amount to watch.

    Regards,
    Chris

  2. #2
    Member
    Join Date
    Jan 2004
    Posts
    106

    Default

    Did you have any luck with this?

  3. #3
    Member
    Join Date
    Mar 2004
    Location
    Montreal
    Posts
    23

    Default

    I have read a post here on this before. I am trying in vain to locate the right keyword search combo....I know the answer is here!

  4. #4
    cPanel Product Evangelist Infopro's Avatar
    Join Date
    May 2003
    Location
    Pennsylvania
    Posts
    7,172
    cPanel/Enkompass Access Level

    Root Administrator

    Lightbulb

    There is such a script that I think you might find useful called fix404errors located here. cPlicensing: cPanel Scripts

    Never used it myself, but you may be able to work with it and edit for favicons as well.

    For this reason, its a good thing to mention (for others who read this) that adding all required error pages (not just a 404), favicon, robots.txt and whatever else you feel is needed to the cpanel3-skel in advance of creating any new accounts. so you can avoid this sort of issue down the road.

    I remember dealing with this years ago myself and went thru every account manually and added what was missing, the log entries were driving me nuts.

    HTH

Similar Threads & Tags
Similar threads

  1. Replies: 3
    Last Post: 04-19-2010, 03:14 PM
  2. Turn off or rename "error_log"
    By Strikeplate in forum New User Questions
    Replies: 1
    Last Post: 05-27-2006, 06:21 AM
  3. Apache Rebuild: "Use System Mysql" and "Mysql Module"
    By fdesign in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 12-24-2003, 05:14 PM
  4. error_log "has no VirtualHosts"
    By Networkologist in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 04-23-2003, 11:30 PM
Tags for this Thread
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube