AWStats Installer

Discussion in 'Tips/Tricks/Mods' started by jnsc, Oct 6, 2006.

  1. swieep

    swieep New Member

    Thank you..

    I will have a look in the forum, it's not only about the scroll down menu's, it's more about the side menu is now displayed horizontal in a not so nice manner.

    I will give this a try, if it does not work I will create one big log file and run the cronjob once and copy back the current log file..
     
  2. jnsc

    jnsc rotaredoM Moderator

    I just released a new version of the installer which do not depend on php anymore.
     
  3. chillifire

    chillifire New Member

    still having icon problems

    Hi jnsc,
    I tried your new shell script installer. It works well in so far that is produces the stats, but yes, the dreaded icons are still missing in my case. The problem apears obvious to me:
    Your script is using the sed script command and the apache.sed file to look for an occurence of /Alias /icon/ in first the apache2.conf script, if that does not exist in httpd.conf script and if that does not exist in the default-server.conf script, thus catering for the different apache flavours out there. Once a line with /Alias /icon/ is found the lines in apache2.sed with a new alias pointing to the awstat icons is appended. very nice, but the whole script hinges on the assumption, that an icon alias is already in the apache configuration script. Well, in my Ubuntu 7.10 server it is not (for whatever reason) and I have followed the Perfect Server howTos, so I dare say it is not a praticular 'strange' configuration.
    Before I embark on trial and error, where was the icon alias supposed to go to? Was it supposed to go into the ISPConfig append section between the directory tags? Or somewhere else? Please advise.

    Code:
    ###############ispconfig_log###############
    LogFormat "%v||||%b||||%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined_ispconfig
    CustomLog "|/root/ispconfig/cronolog --symlink=/var/log/httpd/ispconfig_access_log /var/log/httpd/ispconfig_access_log_%Y_%m_%d" combined_ispconfig
    
    <Directory /var/www/*/web>
        Options +Includes -Indexes
    
    [B][I]????Does awstat icon alias go somewhere here????[/I][/B]
    
        AllowOverride None
        AllowOverride Indexes AuthConfig Limit FileInfo
        Order allow,deny
        Allow from all
        <Files ~ "^\.ht">
        Deny from all
        </Files>
    </Directory>
    Great work with the script though. You may wish to find another 'anchor' for your icon alias insertion.

    Thanks and I hope this post is helpful for you

    chillifire
     
  4. jnsc

    jnsc rotaredoM Moderator

    Yes, I know that the weak part of this installer is the sed script.

    the awstats directive
    Code:
    ### AWStats Section ###
    Alias /icon "/home/admispconfig/ispconfig/tools/awstats/wwwroot/icon/"
    ### End of AWStats Section ###
    It does not go in the Directory statement. It goes outside. Personally it's just after the Include statements.

    I will have a look at apaches default configuration in ubuntu.

    Regards
     
  5. Insane1

    Insane1 New Member

    Awstats works great, but i've got a question:

    -can i disable the option for webalizer statistics for my webs? or does this option also disable awstats?
     
  6. jnsc

    jnsc rotaredoM Moderator

    No, you will have to keep the webalizer option. AWStats uses the webalizer option in the stable branche, as I want it to be the less intrusive as possible. In the dev branch (2.3.X) you can choose if you want webalizer or AWStats, but not in the stable.
     
  7. Insane1

    Insane1 New Member

    hmm ok. But i can delete webalizer from the crontab?
     
  8. jnsc

    jnsc rotaredoM Moderator

    Yes, that's possible.
     
  9. Insane1

    Insane1 New Member

    k, thanks.

    Do you have any idea how I can import my awstats data from my old server? It's just the awstats data left, no log files. And the old server had no ispconfig. it would be great if I could move the existing statistics to the new server
     
  10. radim_h

    radim_h Member

    All you need to do is just copy your old awstats data into /home/admispconfig/ispconfig/web/ispc.awstats.data.
    Make sure these have same name format as "awstatsMMYYYY.www.domain.tld.txt"
     
  11. Insane1

    Insane1 New Member

    ispc.awstats.data does not exist :confused:

    edit: aaah i got it. they're stored in /var/www/webXY/web/awstats/awstats042008.www.domain.de.txt

    thanks a lot guys :):)
     
    Last edited: Jun 4, 2008
  12. radim_h

    radim_h Member

    Is is working with DJTremors script?
    oR with static pages describe here http://www.howtoforge.com/awstats_ispconfig ?

    EDIT:
    sorry i was in wrong thread, this one is discussing the link above :)
     
    Last edited: Jun 5, 2008
  13. redi78

    redi78 New Member

    Hello,

    i have a question. How can i deinstall awstats installer?

    redi78
     
  14. jnsc

    jnsc rotaredoM Moderator

    Remove the crontab entry.

    Delete:
    /root/ispconfig/scripts/shell/awstats.php
    /etc/awstats
    /home/admispconfig/ispconfig/tools/awstats*

    Remove this lines from apache config file:
    ### AWStats Section ### \
    Alias /icon "/home/admispconfig/ispconfig/tools/awstats/wwwroot/icon/" \
    ### End of AWStats Section ###
     
  15. redi78

    redi78 New Member

    Hi,

    perfect. Thank you.

    Greetings from vienna.
     
  16. Rasputin

    Rasputin New Member

    Hi jnsc, thank you for your great work it runs almost out-of-the-box.
    But there are two things I want to say.

    1) I used the latest version of the awstats installer and there is some minor issue.
    While running the awstats.php from the command line I received the following warning:
    Code:
    Warning: chmod(): No such file or directory in /root/ispconfig/scripts/shell/awstats.php on line 206
    This refers to:
    PHP:
    chmod("$stats_path/index.php",0644);
    As there is no index.php in the awstats directory it doesn't make sense to invoke call here.


    2) Regarding the icon issue I would suggest a solution using symlinks. This has the advantage that you don't have to change the apache configuration.
    You only have to do some adjustments in the awstats.php.

    Add the following code at line 78 to create the symlink in the awstats directory:
    PHP:
    $icon_path $stats_path."/icon";
    if(!@
    is_link($icon_path)){
        
    symlink("/home/admispconfig/ispconfig/tools/awstats/wwwroot/icon/"$icon_path);
        
    chown($icon_path$web_user);
        
    chgrp($icon_path$web_group);
        
    $message .= "Erstelle Icon Verzeichnis: $icon_path\n";
    }     
    Now change the call at line 184 and add the option -diricons=icon to set the relative path to the icon diretory:
    PHP:
    $message .= exec("perl /home/admispconfig/ispconfig/tools/awstats/tools/awstats_buildstaticpages.pl -year=$year -month=$month -update -config=$web_real_name -awstatsprog=/home/admispconfig/ispconfig/tools/awstats/wwwroot/cgi-bin/awstats.pl -builddate=$year-$month -dir=$stats_path -diricons=icon")."\n";
    Edit:
    As I had to deal with a 403 error there is something additional to be mentioned.
    The directory /home/admispconfig/ispconfig/tools/awstats/wwwroot/icon/ should be world readable and executable so maybe it is the best way to modify the install.sh script and call chmod recursively:
    Code:
    chmod -R 755 /home/admispconfig/ispconfig/tools/awstats-6.7/
    
    And apparently you have created the tar.gz preserving the permissions which causes a weird assignment of existing users and groups when you extract it.
     
    Last edited: Jul 21, 2008
  17. jnsc

    jnsc rotaredoM Moderator

    Hello,

    Sorry for the late reply, I was on vacation :).

    Your are right, older versions where using index.php, but it's not needed anymore.

    For the other remarks I will do a little bit of testing, so i can release a new version with the latest AWStats version.
     
  18. bolero

    bolero New Member

    What's the advantage of awstats over webalizer in reports? All that I know of it is that it's got a really long history of security bugs which makes me wary to ever install it.
     
  19. jnsc

    jnsc rotaredoM Moderator

    The first reason, is that I prefere the look of AWStats, and the statistics are more precise. The other main reason is that webalizer is not actively maintained since 2002.

    Here is an outdated feature comparison page, but as no new version of webalizer has been released since it should be usable. http://awstats.sourceforge.net/docs/awstats_compare.html

    For your concerns about security, I had the same, and it's why this script generates static pages instead of using directly the perl script.
     
  20. bolero

    bolero New Member

    Thanks for the info! I may try it if customers want "more" ;-) I used analog for many years and found that already sufficient. I'm still using it for many clients.
     

Share This Page