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.

how to restart cpanel access_log (zero entries)

Discussion in 'General Discussion' started by zombo, Oct 3, 2010.

  1. zombo

    zombo Active Member

    Joined:
    Jan 28, 2004
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Austria
    my /usr/local/cpanel/logs/access_log had 233MB and I saw it was not rotated for a long time, though it is checked to be rotated in whm. There is no problem with the rotation of the other logfiles.

    to save some disk space I did a

    cd /usr/local/cpanel/logs
    rm access_log
    touch access_log
    chmod 600 access_log

    I restarted apache via whm
    and I did a /scripts/restartsrv_cpanellogd

    but the cpanel logins are no longer logged.
    Which additional process do I have to restart?
     
  2. GaryT

    GaryT Well-Known Member

    Joined:
    May 19, 2010
    Messages:
    321
    Likes Received:
    3
    Trophy Points:
    16
    Restart Exim aswell.
     
  3. zombo

    zombo Active Member

    Joined:
    Jan 28, 2004
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Austria
    I restarted exim (though I cannto see how exim is related to cpanel logging) and I tried access from different IP's but again

    /usr/local/cpanel/logs/access_log

    does not get any entries. Can anyone put in other ideas? Thanking you very much in advance ....
     
  4. whr

    whr Active Member

    Joined:
    Jul 25, 2009
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    India
    Make sure that the user:group for the file is root:root /usr/local/cpanel/logs/access_log

    The permission is correct.

    Try restarting all the services including cPanel

    killall -9 -v httpd
    killall -9 -v php
    /etc/init.d/mysql restart
    /etc/init.d/httpd start
    /etc/init.d/cpanel restart
    /etc/init.d/xinetd restart


    and then

    /scripts/restartsrv_cpanellogd
    /scripts/restartsrv_tailwatchd
    /scripts/restartsrv_chkservd
     
  5. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    The default log rotation size threshold is 300 MB -- consider adjusting as needed

    cPanel can be restarted using the following command:
    Code:
    # /usr/local/cpanel/startup
    By default, logs rotated by cPanel/WHM must reach a size threshold of 300 MB before being automatically rotated; however, this threshold can be modified using the variable rotatelogs_size_threshhold_in_megabytes that can be defined in /var/cpanel/cpanel.config. The CLI utility "grep" may be used to output the current value of the variable if it is defined; the following example shows the threshold set to a custom value of "30" MB:
    Code:
    # grep rotatelogs_size_threshhold_in_megabytes /var/cpanel/cpanel.config
    rotatelogs_size_threshhold_in_megabytes=30
    In cPanel 11.28, the log rotation size threshold can be configured using WebHost Manager via the following menu path (with linked documentation):
    WHM: Main >> Server Configuration >> Tweak Settings >> Stats and Logs
    • Log rotation size threshold [?] Threshold above which cpanellogd will rotate log files (Minimum: 10)
      • 300 MB default
      • [_____] Meg (input a custom value)

    Note: At the time of writing, cPanel 11.28 is available as development version 11.27, formerly 11.25.1, in the EDGE release tier. For the latest version information please refer to the following official resource: Latest cPanel/WHM Builds
     
  6. zombo

    zombo Active Member

    Joined:
    Jan 28, 2004
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Austria
    Just wanted to drop a *thankyou*. As a final hint I add, that whenever one deletes a logfile, and creates a new empty file it is most often necessary to restart the process that "fills" this logfile (e.g. restart apache when apache logfiles are involved) The puzzle is only to find out which process is writing to the logfile.
    /usr/local/cpanel/startup actually starts a perl programme, that kills and restarts all involved processes.
    It would probably be more intelligent not to delete and re-create the file but only empty it... I'll have a look into the logrotate progs to look how they do that, but at the moment I am happy with what I've learned.
     
Loading...

Share This Page