Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Mar 2003
    Posts
    427

    Default Stats for all accounts - idea/tip !

    Note: I'm not a gury - don't know if this can mess things up or if there's a much better idea.

    I tested to add a second "CustomLog" line in httpd config for an account and it works.
    So if I install a dummy account on the server and then add a second domlogs to all other accounts in httpd that points to dummy file, I will have the stats for all accounts combined
    for awstats, webalizer etc.

    My dummy:
    serverstats.com

    In httpd:
    CustomLog domlogs/serverstats.com combined

    Now I add this line to all other accounts as well so stats is written to both the
    accounts own logfile and to this one.

    NOTE: Only a small test has been made - you do it on your own risk - I have no idea
    if it will mess something up other than the logfile will be huge so you better run stats
    often - depending on how heavy stats is.
    Just add a cronjob: */30 * * * * /scripts/runweblogs "serverstats.com's_username".
    This will run stats for this account ever 30 minutes.

    QUESTION:
    Is there a template for apache so I can add a line like this auto for new accounts ?
    Anyone have a command we can use to add this line for all account already setup ?

  2. #2
    Member
    Join Date
    May 2005
    Posts
    22

    Default

    Hi,

    You will have to manually change them or use VI editor and use a whole bunch of flags to accomplish what you are trying to do. If you do not know how to use VI then I would not suggest even trying as your httpd.conf file is very important. I would suggest you to just edit the lines manually, and any new accounts created you will have to just add as well.

    -Bash

  3. #3
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    Actually, there is a template for new virtualhost containers. Look in:

    /usr/local/cpanel/etc/httptemplates/apache1

    You could also do it as part of creating /scripts/postwwwacct (search the forums about that)
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  4. #4
    Member
    Join Date
    Mar 2003
    Posts
    427

    Default

    Thanks for the template tip.

    I used my sftp program cuteFTP (very good) to replace/add the custom log line for all accounts.

    What I did was to use a replace function in the text of a file.
    I replaced all "combined" words with:

    combined
    CustomLog domlogs/serverstats.se combined

    That way this:
    CustomLog domlogs/domainbla.com combined

    Became this:
    CustomLog domlogs/domainbla.com combined
    CustomLog domlogs/serverstats.se combined

    Important: I first cut out all the accounts, from first virtual host to the last and did this
    in a new file and then pasted everything back again with new lines.
    I did this because the word "combined" might be somewhere else where we don't wanna do this - it might mess things up.

    As always - save a backup of the httpd.conf before you edit it.

    This works very good so far and it's pretty cool to have all accounts stats in one awstats.
    Now it would be cool to have all servers stats on one account :-)

Similar Threads & Tags
Similar threads

  1. Tip:Fixing repquota issues and slow "List Accounts"
    By hicom in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 01-20-2008, 03:40 PM
  2. An easy way to view stats on all accounts?
    By tekdev73 in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 06-13-2007, 10:34 PM
  3. TIP: Zero downtime transition between servers for multiple accounts...
    By hostww in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 09-09-2006, 04:58 PM
  4. Never had stats on some accounts ??
    By jeroman8 in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 10-27-2003, 01:49 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube