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.

AwStats :: Need to lock some config files

Discussion in 'General Discussion' started by OneSizeFitsAll, May 1, 2005.

  1. OneSizeFitsAll

    OneSizeFitsAll Well-Known Member

    Joined:
    Dec 19, 2002
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    6
    Hello,

    AwStats :: Need to lock some config files on a per account/needs basis.

    I have couple special accounts on my server that needs the "URLWithQuery" option, set to 1:
    URLWithQuery=1

    This, to make sure the files being downloaded through their CMS are fully identified in the stats reports.

    Question:
    How could I make sure that this config file:
    "awstats.domainnamehere.conf" DOES NOT get overwritten next month?
    I do not wish to have to go in again and edit theses conf files every months. :rolleyes:
    How to lock this/these conf file(s)?

    I just want to make sure that when the AwStats program is being automagicaly updated on the server wide, that these special account's config files does also get updated and keep the "URLWithQuery=1" preset.

    Any insight would be appreciated...

    Kind Regards,
     
  2. RickG

    RickG Well-Known Member

    Joined:
    Feb 28, 2005
    Messages:
    238
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    North Carolina
    I had a similar challenge. There is no way to stop the domain's conf file from being re-created with the default template at each run.

    However :)

    After much searching / reading I discovered AwStats has the ability to include an external conf file. Here's what I was able to implement:

    1) edit the main AwStats template at /usr/local/cpanel/etc/awstats.conf
    2) add the following to the very last line of the file:

    Include "%AWSTATSDIR%custom.txt"

    Next time stats are run and the file /tmp/awstats/awstats.domainname.com.conf is recreated, it will have the "include" line at the end (which will translate to /tmp/awstats/custom.txt)

    Any directives in your include file take precedence over values in the conf file.

    One caveat: you will need to place a file called custom.txt in every account's /tmp/awstats/ directory otherwise an error occurs when they view stats. The file can be blank if you are not using any special directives for a particular domain ... it just needs to be there.

    Hope this helps!

    Rick
     
    #2 RickG, May 2, 2005
    Last edited: May 2, 2005
  3. OneSizeFitsAll

    OneSizeFitsAll Well-Known Member

    Joined:
    Dec 19, 2002
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    6
    Thank you for your input Rick,

    Although... the more I think about it, the more I tend to think that I should set this option, "server wide" instead. Not sure yet if I will yet... thinking and juggling with the idea... :rolleyes:

    Sincerly appreciate the details of your explanations above.

    Kindly,

    Yves
     
  4. RickG

    RickG Well-Known Member

    Joined:
    Feb 28, 2005
    Messages:
    238
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    North Carolina
    Hi Yves:

    You certainly could make the change globally by simply editing the /usr/local/cpanel/etc/awstats.conf. I considered this as well. The only thing you'd have to keep in mind is that this master template may be overwritten if one upgrades AwStats (which is not that often).

    AwStats has many more options than I think most realize. You may want to take a look at their online documentation at http://awstats.sourceforge.net/docs/index.html

    In the end, I found using an external conf file a very flexible way to include everything from client logos on reports, custom restrictions and plugins ... even extra tables and charts based on criteria I set.

    Have fun -
     
Loading...

Share This Page