Awstats

FerienBSD

Well-Known Member
hallo allerseits,

auf meinem fbsd 7.1 server möchte ich gerne awstats installieren. nun da meine kist nicht ganz standard ist, treten einige kleine komplikationen auf, bei denen ich froh währe um ein wenig unterstützung von jemandem der sich damit auskennt.

fbsd 7.1-release
awstats 6.8_1.2
apache 2.0.63

auf meinem server fahre ich ca. 15 hostings alle im virtualhost.conf definiert, im http.conf verweist ein include befehl auf dieses file.

eigentlich möchte ich awstats zentral installiert haben und nicht für jedes hosting kompletten filesatz kopieren müssen.

in einem sammel.config file möchte ich die hostings auflisten und konfigurieren können. wenn ich nun awstats via cron ausführen lasse sollten alle hostings "geupdatet" werden.

hat das schonmal jemand gemacht?


gruss
 
auf meinem server fahre ich ca. 15 hostings alle im virtualhost.conf definiert, im http.conf verweist ein include befehl auf dieses file.

eigentlich möchte ich awstats zentral installiert haben und nicht für jedes hosting kompletten filesatz kopieren müssen.

in einem sammel.config file möchte ich die hostings auflisten und konfigurieren können. wenn ich nun awstats via cron ausführen lasse sollten alle hostings "geupdatet" werden
So wäre mir das auch am liebsten aber ich habe nicht herausgefunden, wie das funktionieren könnte (ich hatte auch keine rechte Lust, weil ich auch recht wenige vHosts habe).

Deshalb existiert bei mir in /usr/local/etc/awstats/ für jeden vHost eine Konfigurationsdatei und ein periodic Script verwurschtet nächtlich die Logdateien. In der jeweiligen vHost Konfiguration ist dann noch

/usr/local/etc/periodic/daily/909.awstats

Code:
#!/bin/sh
#
# awstats script v1.0
#
# In public domain, do what you like with it,
# and use it at your own risk... :)

# Define these variables in either /etc/periodic.conf or
# /etc/periodic.conf.local to override the default values.
#
# daily_awstats_enable="NO"     # enable this script

daily_awstats_enable="NO"       # disable this script by default
daily_awstats_script="/usr/local/www/awstats/cgi-bin/awstats.pl"        # script to run

# If there is a global system configuration file, suck it in.
#
if [ -r /etc/defaults/periodic.conf ]
then
    . /etc/defaults/periodic.conf
    source_periodic_confs
fi

rc=0

case "$daily_awstats_enable" in
    [Yy][Ee][Ss])

        # update awstats for virtual hosts
        echo ""
        echo "Updating AWStats web statistics for virtual hosts"
        echo ""
        for CONF in /usr/local/etc/awstats/*.conf; do
                HOST=$(basename $CONF .conf | cut -d '.' -f2-)
                perl ${daily_awstats_script} -config=$HOST
        done
        ;;
esac

exit $rc

Mit einer zentralen awstats.conf wird für alle vHosts der Zugriff ermöglicht:

Code:
#
# Directives to allow use of AWStats as a CGI
#
Alias /awstatsclasses "/usr/local/www/awstats/classes/"
Alias /awstatscss "/usr/local/www/awstats/css/"
Alias /awstatsicons "/usr/local/www/awstats/icons/"
Alias /stats/ "/usr/local/www/awstats/cgi-bin/"
Alias /stats  "/usr/local/www/awstats/cgi-bin/"
Alias /statistik/ "/usr/local/www/awstats/cgi-bin/"
Alias /statistik  "/usr/local/www/awstats/cgi-bin/"

#
# configuration for awstats basedir
#
<Directory "/usr/local/www/awstats">
    Options FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

#
# This is to permit URL access to scripts/files in AWStats directory.
#
<Directory "/usr/local/www/awstats/cgi-bin">
    Options Indexes ExecCGI FollowSymlinks
    DirectoryIndex awstats.pl
    AddHandler cgi-script .pl
    AllowOverride None
    AuthName 'Protected Area'
    AuthType Basic
    AuthUserFile /usr/local/www/awstats/.htpasswd
    AuthGroupFile /dev/null
    require valid-user
    Order allow,deny
    Allow from all
</Directory>

Das hat ein bisserl den Nachteil, dass jeder User im Prinzip die Statistiken der anderen vHosts auch abrufen kann, was bei mir kein Problem darstellt.

HTH a bit & Ciao.
Markus Mann
 
Zurück
Oben