1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Awstats and Plesk

Discussion in 'Plesk for Linux - 8.x and Older' started by baravalle, Dec 8, 2006.

  1. baravalle

    baravalle Guest

    0
     
    Hi,
    It took me some time, but I managed to configure Plesk with Awstats and now I tought that it would have been good to share my results.

    Trying to have awstats working with Plesk is not too easy - it took me a few hours. And in fact is not that integrated...

    Anyway, that's how I've done it.

    The most important point is having the directory layout that Plesk expects.

    That, at least in my case, was not the one that I had with my normal RPM installation on Centos.

    Here are the steps to solve the problem(s). You will have to create symbolic links to the files.

    Plesk is expecting to find:
    /var/www/cgi-bin/awstats (in my system I had /var/www/awstats)
    /var/share/awstats/ with the awstats *.pl files (in my system they were in /usr/bin)
    /usr/local/psa/etc/awstats/awstats.domainname-http.conf (in my system the configuration files were in /etc/awstats and had a different name pattern)

    Use:
    rpm -ql awstats

    to find where your awstats has installed the files.

    After doing that, to test if you are going in the right direction, try to run:

    /usr/bin/awstats_updateall.pl now -confdir="/usr/local/psa/etc" -awstatsprog="/var/www/awstats/awstats.pl"

    (use your awstats.pl path)

    If it works, then run the Plesk program that generates statistics, to make sure that everything is fine:
    /usr/local/psa/admin/sbin/statistics

    Debug as needed in this step...

    Sidenote: the awstats configuration files are not updated (apparently) when you update the domain aliases. If you update your domain aliases you will have to update them in the configuration file by hand.

    If you have domains that you do not manage with Plesk in your server (I do have some of them, for non profit organisations), you can mimic the plesk scripts with a couple of scripts.

    First, you need to have the log file processing enabled in your crontab.

    I'm using this slightly modified version of the script included with awstats (it's in /etc/cron.daily/00awstats in my system):
    #!/bin/bash

    if [ -f /var/log/httpd/access_log ] ; then
    exec /usr/bin/awstats_updateall.pl now -configdir="/etc/awstats" -awstatsprog="/var/www/awstats/awstats.pl" >/dev/null
    fi

    if [ -f /var/log/httpd/access_log ] ; then
    exec /usr/bin/awstats_updateall.pl now -configdir="/usr/local/psa/etc/awstats" -awstatsprog="/var/www/awstats/awstats.pl" >/dev/null
    fi

    exit 0

    And then you need a script to create the reports that are not processed by Plesk (apparently Plesk is processing just the domains that are managed by Plesk itself - which makes sense).


    This one (adapt the domains) is what I'm using:

    #!/bin/bash
    domains_to_process=("baravalle.it" "phpgrabcomics.org" "server.phpgrabcomics.org" "verdibiellesi.it")

    len=${#domains_to_process[@]}

    i=0
    while [ $i -lt $len ]; do
    awstats_buildstaticpages.pl -config=${domains_to_process[$i]}-http --configdir="/usr/local/psa/etc/awstats" -lang=it -dir=/home/httpd/vhosts/${domains_to_process[$i]}/statistics/webstat -awstatsprog=/var/www/awstats/awstats.pl
    let i++
    done

    You will have to insert it in your crontab (it needs to be the crontab of a user that has write access to the directories where you are saving you reports).

    Enjoy...

    Andres
     
  2. DavidCollom

    DavidCollom Guest

    0
     
    I found a much easier solution...

    I changed a single domain to use AWstats i then ran the statistics application and looked for file not found etc...

    I then did a locate for the following files: awstats.pl and awstats_buildstaticpages.pl

    after i found these i looked in the plesk config file (/etc/psa/psa.conf)
    i looked for the lines
    and changed the following 2 lines to:
    i then ran the statistics tool once again and all was well and working!
    Job done Full AWstats up and running ;)

    Enjoy!

    ** Update ** sorry forgot to mention that i also updated the awstats.conf file in (/etc/httpd/conf.d/awstats.conf) to allow for global access as images where not loading
     
  3. dfuzion

    dfuzion Guest

    0
     
    Hi DavidCollom,

    Thanks for your tips but which linux distribution are you on cause I don't have any of the folders asked to change :AWSTATS_BIN_D and AWSTATS_TOOLS_D...

    I'm on Debian Sarge 3.1.

    Thanks
     
  4. DavidCollom

    DavidCollom Guest

    0
     
    Hi, Im using Fedora Core 4 updated to FC5
    This was also a clean install sorry
     
  5. dfuzion

    dfuzion Guest

    0
     
    Thanks. My awstats config seems to be ok but I still have no cronjob and statictics are the same for each domain... Waiting for a fix from swsoft...
     
  6. DavidCollom

    DavidCollom Guest

    0
     
    hmm weird. Ive just gone through all of my crons and theirs awstats running hourly! not sure why? its not plesk's stats just awstats directly! ive added two domains to use awstats now and all is looking ok.. no duplicate details!
    altho i did notice awstats took quite a bit longer to compile, altho their is a lot more detail used in awstats to webalizer.

    I do not have any crontabs other than the one above from awstats its self and could not find any. i might simply create my own and see where it go's from there :)
     
  7. mr_exclusive

    mr_exclusive Basic Pleskian

    24
    73%
    Joined:
    Jul 15, 2006
    Messages:
    56
    Likes Received:
    0
    i have changed the paths in /etc/psa/psa.conf

    to

    # AWStats
    AWSTATS_ETC_D /etc/awstats


    and

    AWSTATS_BIN_D /srv/www/cgi-bin
    AWSTATS_TOOLS_D /usr/share/doc/packages/awstats/tools

    system suse 10.0x64
    and i still got error:

    statistics: Unable to execute /usr/share/doc/packages/awstats/tools/awstats_buildingstaticpages.pl -awstatsprog=/srv/www/cgi-bin/awstats.pl --configdir=/usr/local/psa/etc/awstats -config=domain.com -dir=/srv/www/vhosts/domain.com/webstat/

    what should i do to get this working??

    please help me with that.
     
  8. baravalle

    baravalle Guest

    0
     
    Hi,
    did you try to run the command straight from the command line? does it work in that way?

    Andres
     
  9. mr_exclusive

    mr_exclusive Basic Pleskian

    24
    73%
    Joined:
    Jul 15, 2006
    Messages:
    56
    Likes Received:
    0
    from the command line i got
    -bash: ./awstats_buildingstaticpages.pl: No such file or directory

    this is strange
     
  10. mr_exclusive

    mr_exclusive Basic Pleskian

    24
    73%
    Joined:
    Jul 15, 2006
    Messages:
    56
    Likes Received:
    0
    so? how to run awstats?
     
  11. baravalle

    baravalle Guest

    0
     
    Hi there,
    I checked and on my system I do not have the file awstats_buildingstaticpages.pl.

    You can try the method I suggested in my first post, or wait for feedback from DavidCollom.

    Andres
     
  12. DavidCollom

    DavidCollom Guest

    0
     
    I could not find any references to a file
    here is a sample of my output from running "/usr/local/psa/admin/sbin/statistics" Located in /etc/cron.daily/50plesk.daily.sh
    I also have the package "awstats-6.5-7.fc5" installed at this time
     
Loading...