Results 1 to 2 of 2

Thread: Is it possible to set the default value for domlog archiving in WHM?

  1. #1
    Registered Member
    Join Date
    Jan 2010
    Posts
    70

    Default Is it possible to set the default value for domlog archiving in WHM?

    Currently, it is up to the Cpanel user to enable domlog archiving. However, I want to enable this feature by default for all of our clients.

    I am aware of the "Delete each domain's access logs after stats run" setting, but I want to keep an archive of aprox. 5 days for every client.

    Is this possible?
    Last edited by Vliegtuig; 03-16-2010 at 10:01 AM.

  2. #2
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,554
    cPanel/WHM Access Level

    DataCenter Provider

    Lightbulb Automatically enable archival of Raw Access Logs, by-default, for new cPanel accounts

    Quote Originally Posted by Vliegtuig View Post
    Currently, it is up to the Cpanel user to enable domlog archiving. However, I want to enable this feature by default for all of our clients.

    I am aware of the "Delete each domain's access logs after stats run" setting, but I want to keep an archive of aprox. 5 days for every client.

    Is this possible?
    When the specified option is enabled it will save a compressed archive for each month's raw access logs into the "logs" sub-directory of the cPanel user account's home directory path (e.g., within "/home/username/logs/"). The current implementation of archiving is on a monthly basis but keeps the current month updated automatically after each stats processing run. It is not currently possible to set a number of days instead of the per-month behavior. However, it is possible to setup new cPanel accounts where the access log archiving option is enabled (i.e., turned-on) by-default; this can be accomplished by using the cPanel skeleton directory structure that is available to both root (i.e., server administrators) and resellers.

    I recommend reviewing the following posts for additional examples and clarification:


    Using the cPanel skeleton directory you may setup custom files and directory structure that will be installed in the unique home directory of new cPanel user accounts; for example, you may setup a file to store the default preference for monthly archiving of Raw Access Logs.

    To view where your specific skeleton directory is located, simply access the following WHM menu path:
    WHM: Main >> Account Functions >> Skeleton Directory
    • If you're logged-in as root, it should display the following directory path:
      Code:
      /root/cpanel3-skel
    • If you're logged-in as a reseller, it will display a path within your reseller user home directory, similar to the following (where "username" would be your reseller or WHM login username):
      Code:
      /home/username/cpanel3-skel


    As an example, if you wanted to setup access log archiving by default but also have the previous month's archive removed (cleaned) to save space, the following could be entered into a new file using only plain-text without any special fonts or formatting:
    Code:
    archive-logs=1
    remove-old-archived-logs=1
    The above contents should be saved into a file named ".cpanel-logs" and setup in a location like one of the following examples:
    • If you have root access to WHM, the file would be setup here:
      Code:
      /root/cpanel3-skel/.cpanel-logs
    • If you have reseller access to WHM, the file would be setup relative to the home directory path of the logged-in reseller user:
      Code:
      /home/username/cpanel3-skel/.cpanel-logs


    To apply the change preference existing accounts, either of the following methods may be used:
    • Setup while logged-into the desired cPanel account: cPanel: Main >> Logs >> Raw Access Logs >> Configure Logs
    • Setup while logged-into SSH as root (i.e., as the server administrator): The file named ".cpanel-logs" may be duplicated (copied) into the user home directory of any cPanel accounts that need it enabled. This systems administration task is best performed via command-line SSH access while ensuring to set both proper (chmod) access permissions as well as to ensure correct file ownership, to match the applicable cPanel account username. Here is a basic example of how to copy the file and set permissions and ownership via root SSH access; in the commands shown please note that "username" should be replaced by that of the desired cPanel account login username:
      Code:
      # cp -v /root/cpanel3-skel/.cpanel-logs /home/username/.cpanel-logs
      # chown -vv username:username /home/username/.cpanel-logs
      # chmod -vv 0600 /home/username/.cpanel-logs


    Moderator Note: This thread is being closed as it is for a feature that is currently available via existing functionality, that of having archival of domain raw access logs automatically enabled for new user accounts via the cPanel skeleton directory.

Similar Threads

  1. Stop deleting domlogs every 24h by default (better domlog rotation options)
    By quizknows in forum Feature Requests for cPanel & WHM
    Replies: 0
    Last Post: 08-14-2012, 01:46 PM
  2. Set a default language in WHM for all mail lists on a server
    By monarobase in forum Feature Requests for cPanel & WHM
    Replies: 3
    Last Post: 04-06-2010, 05:32 PM
  3. Webmail... set default
    By hostserve in forum E-mail Discussions
    Replies: 7
    Last Post: 06-02-2008, 05:58 AM
  4. Where to set default cpanel theme (x3) in WHM?
    By spaceman in forum cPanel & WHM Discussions
    Replies: 4
    Last Post: 10-01-2007, 11:09 AM
  5. set spamassassin as default?
    By dory36 in forum cPanel & WHM Discussions
    Replies: 4
    Last Post: 04-18-2004, 11:28 AM
bargain