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.

Meaningful custom statistics with Webalizer

Discussion in 'General Discussion' started by Nahoo, Sep 10, 2005.

  1. Nahoo

    Nahoo Member

    Joined:
    Oct 7, 2004
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    After alot of irritation with the way the Weblizer statistics are hidden by inappropriate configurations, I have Webalizer working separated from cPanel.

    If you need custom Webalizer statistics for a major website, here are the steps you need to take to get delicious stats...

    1. Install Webalizer

    You can download a copy from: http://www.mrunix.net/webalizer/download.html
    I suggest going to /tmp and using wget to collect the file.

    Extract the tarball and install as follows:

    tar -zxvf webalizer-2.01-10-src.tar.Z (or similar)
    cd webalizer-2.01-10
    sh configure
    make
    make install

    2. Create a folder in your webroot, ready for your statistic pages.

    Here, I am using: /home/username/public_html/stats/
    I would recommend password protecting this directory (use the password directory tool in cPanel)

    3. Create a nice Webalizer configuration file

    I suggest uploading a file called webalizer.conf to your user's root (e.g. /home/username/). You can also use pico or vi to edit the file on the server.

    Look at the Webalizer website for conf file details. I would have something like this for a start...

    Code:
    # domainname.com Stats
    
    LogFile         /usr/local/apache/domlogs/domainname.com
    OutputDir       /home/username/public_html/stats
    HostName        domainname.com
    HideSite        *domainname.com
    HideReferrer    domainname.com/
    HideReferrer    Direct Request
    HideReferrer    localhost
    LogType         clf
    HistoryName     webalizer.hist
    Incremental     yes
    IncrementalName webalizer.current
    ReportTitle     Statistics for
    HTMLExtension   html
    PageType        htm*
    PageType        cgi
    PageType        html
    PageType        shtml
    PageType        php
    PageType        pl
    PageType        php
    AllSites        yes
    AllURLs         yes
    AllReferrers    yes
    AllAgents       yes
    AllSearchStr    yes
    AllUsers        yes
    TimeMe          yes
    HideURL         *.gif
    HideURL         *.GIF
    HideURL         *.jpg
    HideURL         *.JPG
    HideURL         *.png
    HideURL         *.PNG
    HideURL         *.ra
    HideURL         *.css
    4. Make it happen

    Create a new CRON job using the commands in SSH:
    crontab -e

    Add:
    02 4 * * * /usr/local/bin/webalizer -c /home/username/webalizer.conf

    I would recommend giving this a quick test now (just like CRON would do later) by running the command yourself:

    /usr/local/bin/webalizer -c /home/username/webalizer.conf
    (webalizer -c /home/username/webalizer.conf also works here)


    That's it. Now you can delight in your stats by going to: http://domainname.com/stats and entering your chosen username and password.
     
Loading...

Share This Page