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.

Stats for all accounts - idea/tip !

Discussion in 'General Discussion' started by jeroman8, Jun 29, 2006.

  1. jeroman8

    jeroman8 Well-Known Member

    Joined:
    Mar 14, 2003
    Messages:
    410
    Likes Received:
    0
    Trophy Points:
    16
    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. Bash

    Bash Member

    Joined:
    May 7, 2005
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    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. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    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)
     
  4. jeroman8

    jeroman8 Well-Known Member

    Joined:
    Mar 14, 2003
    Messages:
    410
    Likes Received:
    0
    Trophy Points:
    16
    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 :)
     
Loading...

Share This Page