Sie sind hier : Homepage →  > hier stehen die veralteten Seiten→  Linux (1) (alte) Server-Installationen→  awstats (1) installieren

Nov 2009 - awstats 6.9 installieren unter Suse 11.1 auf
HP-DL380 G2 mit RAID und 2 CPUs und 4 GB SPeicher

Die Installation von awstats ist zwar vermeintlich gut dokumentiert, jedoch bei Suse ist alles anders.

05.) irgendwann vor 4 Monaten awstats per YAST (rudimentär) installiert

Mist :
installiert wurde per yast (oder sogar per rpm) auf dem Suse 11.1 Server hier:
/usr/share/doc/packages/awstats/examples
und hier
/usr/share/awstats

10.) testweises Aufrufen des konfig scripts

perl /usr/share/doc/packages/awstats/examples/awstats_configure.pl

ergibt diese Fehlermeldung !!!!!
========================================================
-----> Running OS detected: Linux, BSD or Unix
Warning: AWStats standard directory on Linux OS is '/usr/local/awstats'.
If you want to use standard directory, you should first move all content
of AWStats distribution from current directory:
/usr/share/awstats
to standard directory:
/usr/local/awstats
And then, run configure.pl from this location.
========================================================

es funktioniert nicht, es (seien) = sind die falschen Verzeichnissse benutzt worden

20.) also alles von /usr/share/awstats nach /usr/local/awstats kopiert !!!, also erst mal nicht gemoved !!

also das hier

[www9.ipw.net - root] /usr/share/awstats $ dir
insgesamt 28
drwxr-xr-x 2 root root 4096 28. Mär 2009  classes
drwxr-xr-x 2 root root 4096 28. Mär 2009  css
drwxr-xr-x 9 root root 4096 28. Mär 2009  icon
drwxr-xr-x 2 root root 4096 28. Mär 2009  js
drwxr-xr-x 5 root root 4096 28. Mär 2009  lang
drwxr-xr-x 2 root root 4096 28. Mär 2009  lib
drwxr-xr-x 2 root root 4096 28. Mär 2009  plugins
[www9.ipw.net - root] /usr/share/awstats $


und auch das hier

[www9.ipw.net - root] /usr/share/doc/packages/awstats $ dir
insgesamt 84
-rw-r--r-- 1 root root 60591 13. Jan 2009  awstats.model.conf
drwxr-xr-x 3 root root  4096 28. Mär 2009  docs
drwxr-xr-x 2 root root  4096 28. Mär 2009  examples
-rw-r--r-- 1 root root   307 13. Jan 2009  README.SuSE
-rw-r--r-- 1 root root  6764 13. Jan 2009  README.TXT
[www9.ipw.net - root] /usr/share/doc/packages/awstats $

nach /usr/local/awstats  kopieren - mühselig

das neue hauptverzeichnis "sei" also jetzt dieses hier

/usr/local/awstats

30.) dort findet man README.SuSE

also lesen mit joe oder mit cat oder mit less
========================================================
Hi
To enable awstats, please add the Variable "AWSTATS"
to APACHE_SERVER_FLAGS in /etc/sysconfig/apache2:

        APACHE_SERVER_FLAGS="AWSTATS"

and restart apache:
       rcapache2 restart
Have a look at the file /etc/apache2/conf.d/awstats.conf
for more details about the logged content.
Have a lot of fun!
========================================================

40.) die Variable habe ich eingebaut - also gleich gemacht !!!

dann gibt es noch die README.TXT

dort steht unter anderem
       * Perl module "Encode" must be available.

50.) erst mal mit YAST prüfen

es könnte ja schon drauf sein, ist es aber bei mir nicht

60.) habe "PERL ENCODE JIS2K" nachinstalliert, nicht aber die chinesischen Zeichen

70.) jetzt den Apache2 neu gestartet

$ rcapache2 restart
[Fri Nov 13 01:59:39 2009] [warn] The Alias directive in /etc/apache2/conf.d/awstats.conf
at line 12 will probably never match because it overlaps an earlier Alias.
Syntax OK
Shutting down httpd2 (waiting for all children to terminate)        done
Starting httpd2 (prefork) [Fri Nov 13 01:59:40 2009] [warn] The Alias directive in /etc/apache2/conf.d/awstats.conf
at line 12 will probably never match because it overlaps an earlier Alias.      done
[www9.ipw.net - root] /etc/sysconfig $

Ist nur ein warning, also mal sehen

80.) also da stimmt was nicht ?????

90.) ein Blick in /etc/apache2/conf.d $ dir

-rw-r--r-- 1 root root  646  3. Dez 2008  apache2-manual.conf
-rw-r--r-- 1 root root 1418 13. Jan 2009  awstats.conf
-rw-r--r-- 1 root root  709  3. Dez 2008  mod_perl.conf
-rw-r--r-- 1 root root  451  3. Dez 2008  php5.conf
-rw-r--r-- 1 root root  387 19. Jan 2009  phpmyadmin.conf

100.) in awstats.conf steht :

========================================================
# The location and format of the access logfile (Common Logfile Format).
# If you do not define any access logfiles within a <VirtualHost>
# container, they will be logged here.  Contrariwise, if you *do*
# define per-<VirtualHost> access logfiles, transactions will be
# logged therein and *not* in this file. In this case you have to
# modify awstats yourself to point to the correct, combined log file.
#
<IfDefine AWSTATS>
    CustomLog /var/log/apache2/awstats.log combined

    Alias /icons/awstats/ "/usr/share/awstats/icon/"   >>>>>>>>>>>>>>>  dies ist die Zeile 12
        <Directory "/usr/share/awstats/icon">
        Options Indexes MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
        </Directory>

    Alias /awstats/lang/ "/usr/share/awstats/lang/"
        <Directory "/usr/share/awstats/lang">
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>

        Alias /awstats/css/ "/usr/share/awstats/css/"
        <Directory "/usr/share/awstats/css/">
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>

        Alias /awstatsclasses "/usr/share/awstats/classes"
        <Directory "/usr/share/awstats/classes">
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>

        Alias /awstats/js/ "/usr/share/awstats/js/"
        <Directory "/usr/share/awstats/js/">
                AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
</IfDefine>
========================================================

was die Warnung bedeutet, ist erst mal nicht verständlich - doch - hat sich gefunden

die alias Variable ist doppelt - hier hab ichdas gelöst

110.) verzweigen in cd /usr/local/awstats

erneutes testweises Aufrufen des config scripts

perl /usr/share/doc/packages/awstats/examples/awstats_configure.pl

120.) der script läuft !!!

[www9.ipw.net - root] /usr/local/awstats $ perl /usr/share/doc/packages/awstats/examples/awstats_configure.pl

----- AWStats awstats_configure 1.0 (build 1.8) (c) Laurent Destailleur -----
This tool will help you to configure AWStats to analyze statistics for
one web server. You can try to use it to let it do all that is possible
in AWStats setup, however following the step by step manual setup
documentation (docs/index.html) is often a better idea. Above all if:
- You are not an administrator user,
- You want to analyze downloaded log files without web server,
- You want to analyze mail or ftp log files instead of web log files,
- You need to analyze load balanced servers log files,
- You want to 'understand' all possible ways to use AWStats...
Read the AWStats documentation (docs/index.html).

-----> Running OS detected: Linux, BSD or Unix

-----> Check for web server install

Enter full config file path of your Web server.
Example: /etc/httpd/httpd.conf
Example: /usr/local/apache2/conf/httpd.conf
Example: c:\Program files\apache group\apache\conf\httpd.conf
Config file path ('none' to skip web server setup):
> none

Your web server config file(s) could not be found.
You will need to setup your web server manually to declare AWStats
script as a CGI, if you want to build reports dynamically.
See AWStats setup documentation (file docs/index.html)

-----> Need to create a new config file ?
Do you want me to build a new AWStats config/profile
file (required if first install) [y/N] ? y

-----> Define config file name to create
What is the name of your web site or profile analysis ?
Example: www.mysite.com
Example: demo
Your web site, virtual server or profile name:
> www.fernsehmuseum.info

-----> Define config file path
In which directory do you plan to store your config file(s) ?
Default: /etc/awstats
Directory path to store config file(s) (Enter for default):
>

-----> Create config file '/etc/awstats/awstats.www.fernsehmuseum.info.conf'
Error: Failed to open '/usr/local/awstats/wwwroot/cgi-bin/awstats.model.conf' for read.
[www9.ipw.net - root] /usr/local/awstats $

hat also so nicht funktioniert !!!!!!!!!!!!!!!!!!!!

130.) der Pfad für die Vorlagen muss auf unserer Web Konfiguration korrigiert werden

also in      /usr/local/awstats/   jetzt    >>>>>   wwwroot und darin >>>> cgi-bin anlegen
und dort awstats.model.conf rein kopieren

140.) erneut

/usr/local/awstats $ perl /usr/share/doc/packages/awstats/examples/awstats_configure.pl
aufrufen

150.) das Resultat :


[www9.ipw.net - root] /usr/local/awstats $ perl /usr/share/doc/packages/awstats/examples/awstats_configure.pl

----- AWStats awstats_configure 1.0 (build 1.8) (c) Laurent Destailleur -----
This tool will help you to configure AWStats to analyze statistics for
one web server. You can try to use it to let it do all that is possible
in AWStats setup, however following the step by step manual setup
documentation (docs/index.html) is often a better idea. Above all if:
- You are not an administrator user,
- You want to analyze downloaded log files without web server,
- You want to analyze mail or ftp log files instead of web log files,
- You need to analyze load balanced servers log files,
- You want to 'understand' all possible ways to use AWStats...
Read the AWStats documentation (docs/index.html).

-----> Running OS detected: Linux, BSD or Unix

-----> Check for web server install

Enter full config file path of your Web server.
Example: /etc/httpd/httpd.conf
Example: /usr/local/apache2/conf/httpd.conf
Example: c:\Program files\apache group\apache\conf\httpd.conf
Config file path ('none' to skip web server setup):
>
Config file path ('none' to skip web server setup):
> none

Your web server config file(s) could not be found.
You will need to setup your web server manually to declare AWStats
script as a CGI, if you want to build reports dynamically.
See AWStats setup documentation (file docs/index.html)

-----> Update model config file '/usr/local/awstats/wwwroot/cgi-bin/awstats.model.conf'
  File awstats.model.conf updated.

-----> Need to create a new config file ?
Do you want me to build a new AWStats config/profile
file (required if first install) [y/N] ? y

-----> Define config file name to create
What is the name of your web site or profile analysis ?
Example: www.mysite.com
Example: demo
Your web site, virtual server or profile name:
> www.fernsehmuseum.info

-----> Define config file path
In which directory do you plan to store your config file(s) ?
Default: /etc/awstats
Directory path to store config file(s) (Enter for default):
>

-----> Create config file '/etc/awstats/awstats.www.fernsehmuseum.info.conf'
 Config file /etc/awstats/awstats.www.fernsehmuseum.info.conf created.

-----> Add update process inside a scheduler
Sorry, configure.pl does not support automatic add to cron yet.
You can do it manually by adding the following command to your cron:
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=www.fernsehmuseum.info
Or if you have several config files and prefer having only one command:
/usr/local/awstats/tools/awstats_updateall.pl now
Press ENTER to continue...


A SIMPLE config file has been created: /etc/awstats/awstats.www.fernsehmuseum.info.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for 'www.fernsehmuseum.info' with command:
> perl awstats.pl -update -config=www.fernsehmuseum.info
You can also build static report pages for 'www.fernsehmuseum.info' with command:
> perl awstats.pl -output=pagetype -config=www.fernsehmuseum.info

Press ENTER to finish...
[www9.ipw.net - root] /usr/local/awstats $

160.) Das ist natürlich leicht übertrieben:

A SIMPLE config file has been created. Der File ist 60 Kilo gross und
besteht aber zu 95% nur aus Anleitungen und Kommentaren.

170.) erster Versuch für eine simple statistik

zuerst wechseln in      /srv/www/cgi-bin     und dort aufrufen

perl awstats.pl -config=www.fernsehmuseum.info -update

(das ist unsere Beispieldomain aus diesem Server)

180.) Ergebnis :

[www9.ipw.net - root] /srv/www/cgi-bin $ perl awstats.pl -config=www.fernsehmuseum.info -update
Error: AWStats database directory defined in config file by 'DirData' parameter (/var/lib/awstats) does not exist or is not writable.
Setup ('/etc/awstats/awstats.www.fernsehmuseum.info.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).
[www9.ipw.net - root] /srv/www/cgi-bin $

190.) in /var/lib das Verzeichnis "awstats" angelegt

200.) nochmal laufen lassen

210.) Ergebnis :

[www9.ipw.net - root] /srv/www/cgi-bin $ perl awstats.pl -config=www.fernsehmuseum.info -update
Create/Update database for config "/etc/awstats/awstats.www.fernsehmuseum.info.conf" by AWStats version 6.9 (build 1.925)
From data in log file "/var/log/httpd/mylog.log"...
Error: Couldn't open server log file "/var/log/httpd/mylog.log" : Datei oder Verzeichnis nicht gefunden
Setup ('/etc/awstats/awstats.www.fernsehmuseum.info.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).
[www9.ipw.net - root] /srv/www/cgi-bin $

220.) von Hand die awstats für www.fernsehmuseum.info Konfigurationsdatei korrigiert

Verzeichnisse überprüft und jetzt nochmal gestartet

230.) er rennt duch die 3,6 Gigabyte Log-Datei

[www9.ipw.net - root] /srv/www/cgi-bin $ perl awstats.pl -config=www.fernsehmuseum.info -update
Create/Update database for config "/etc/awstats/awstats.www.fernsehmuseum.info.conf" by AWStats version 6.9 (build 1.925)
From data in log file "/var/log/apache2/access.log"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
Phase 2 : Now process new records (Flush history on disk after 20000 hosts)...

und rennt und rennt  - eine CPU hat immer 100%
ausser putty stürzt unerkannt ab, dann wars das .
und gleichzeitiges Surfen auf diesem Server geht erstaunlich schnell

220.) anscheinen hat YAST einen cronjob etabliert

der in   /etc/cron.d     wohnt    und   suse.de-awstats   heißt.

der Inhalt sieht so aus:
========================================================
#update reports every 6 hour
-0 */6 * * *     root  /usr/sbin/awstats-update
========================================================

230.) der Inhalt von awstats-update sieht so aus:

das nur zur Information, was der Cronjob da aufruft:

========================================================
#!/usr/bin/perl -w
#-Description-------------------------------------------
# Launch update process for all config files found in a particular directory.
# See COPYING.TXT file about AWStats GNU General Public License.
#-------------------------------------------------------
# Based on awstats_updateall.pl from Laurent Destailleur
use strict;

my $DEBUG=0;
my $DIRCONFIG = "/etc/awstats";
my $AWSTATSSCRIPT = "/srv/www/cgi-bin/awstats.pl";

# Scan directory $DIRCONFIG
opendir(DIR, "$DIRCONFIG") || die "Can't scan directory $DIRCONFIG\n";
my @files = grep { /^awstats\.(.*)conf$/ } sort readdir(DIR);
closedir(DIR);

# Run update process for each config file found
if (@files) {
        foreach (@files) {
                if ($_ =~ /^awstats\.(.*)conf$/) {
                        my $domain = $1||"default";
                        my $AllowToUpdateStatsFromBrowser=0;
                        my $DirData="";
                        $domain =~ s/\.$//;
                        open (FILE,"<$DIRCONFIG/$_") || die "Could not open $_:$!\n";
                        while (<FILE>){
                                if (/^AllowToUpdateStatsFromBrowser\s*=\s*1/){
                                        $AllowToUpdateStatsFromBrowser=1;
                                }
                                if ((/^DirData\s*=\s*\"(.*)\"/) || (/^DirData\s*=\s*(.*)/)){
                                        $DirData=$1;
                                }
                        }
                        close(FILE);
                        if ($DEBUG){
                                print "Update domain                : $domain\n";
                                print "AllowToUpdateStatsFromBrowser: $AllowToUpdateStatsFromBrowser\n";
                                print "DirData                      : $DirData\n";
                                print "Running: $AWSTATSSCRIPT -config=$domain -update 2>&1\n";
                        }
                        my $output = `"$AWSTATSSCRIPT" -config=$domain -update 2>&1` if (!$DEBUG);
                        if ($AllowToUpdateStatsFromBrowser){
                                opendir(DIRDATA, "$DirData") || die "Can not scan $DirData: $!\n";
                                my @datafiles = grep { /.*$domain.*/ } sort readdir(DIRDATA);
                                closedir(DIRDATA);
                                if (@datafiles){
                                        system("chown wwwrun:www $DirData/*$domain*");
                                        print "chown wwwrun:www $DirData/*$domain*\n" if ($DEBUG);
                                }
                        }
                }
        }
}

0;      # Do not remove this line
========================================================

250 - wo schreibt er die Ergebnisse hin ?

und am Ende müssen hier in     /var/lib/awstats    einige neue Files drinnen stehen : 

299 - Abbruch der Dokumentation hier und Kommentar

Da  muss noch viel repariert und konfiguriert werden, es ist nicht trivial.

Bei Suse ist alles in anderen Verzeichnissen gelandet als vom Autor der Software vorgesehen.

Warum weiß keiner so genau, warum "Die" alles anders machen.


Hier ein Text aus einem Forum:
Du brauchst (eigentlich) nur den Alias "/awstats-icon" auf das Icon Verzeichnis zu setzen.
Dann noch den Scriptalias /awstats oder wie du es nennen willst auf das CGI Verzeichnis, fertig.


hier nochmal prüfen, ob das stimmt

    Alias /awstatsclasses "/usr/share/doc/awstats/examples/wwwroot/classes/"
    Alias /awstatscss "/usr/share/doc/awstats/examples/wwwroot/css/"
    Alias /awstatsicons "/usr/lib/cgi-bin/awstats/"
    ScriptAlias /awstats/ "/usr/lib/cgi-bin/awstats/"

stimmt natürlich nicht !!

300 - habe sehr viel nachgearbeitet und mühsam rausgefunden

also die awstats.conf Default-Datei steht in /etc/apache2/conf.d und muss auch noch korrigiert werden

<IfDefine AWSTATS>
    CustomLog /var/log/apache2/awstats.log combined

    Alias /icons/awstats/ "/usr/local/awstats/icons/"
        <Directory "/usr/local/awstats/icons">
        Options Indexes MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
        </Directory>

    Alias /awstats/lang/ "/usr/local/awstats/lang/"
        <Directory "/usr/local/awstats/lang">
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>

        Alias /awstats/css/ "/usr/local/awstats/css/"
        <Directory "/usr/local/awstats/css/">
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>

        Alias /awstatsclasses "/usr/local/awstats/classes"
        <Directory "/usr/share/local/classes">
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>

        Alias /awstats/js/ "/usr/local/awstats/js/"
        <Directory "/usr/share/local/js/">
                AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
</IfDefine>

340 - GANZ WICHTIG - der Apache Errorlog file

Die von awstats benutzen icons können weder im /htdocs verzeichnis noch im /cgi-bin verzeichnis ausgeliefert werden, keine Rechte.

Am Ende habe ich sie nach "/usr/share/apache2/icons/other" kopiert und mit chown auf wwwrun;www gesetzt, so wie alle anderen Apache icons dort auch.

Rausgefunden hatte ich das nur mit :

tail -f error_log  im Verzeichnis   /var/log/apache2 ,

weil dort immer die Fehler in rauhen Mengen eintrudeln und dort sieht man, aus welchem Verzeichnis die *.png Bilder kommen sollten, aber doch nicht abrufbar sind.

Letztendlich kommt dann immer öfter das richtige aktuelle Verzeichnis mit der Meldung "permisson failed".

Das stimmt alles überhaupt nicht mit der Doku überein.

Also lassen Sie das log immer mitlaufen, am besten auf einem separaten (putty-) Bildschrim

400 - Am Ende war es doch schon sehr mühsam,

. . . mit mittleren bis vielleicht guten Suse-Linux Kenntnissen das awstats global auf dem Server zum Laufen zu bringen und über eine Serverdomain alle virtuellen Domains abzufragen.

Wenn ich nicht einen anderen Server mit awstats 6.2 von vor 4 Jahren als fortlaufendes und funktionierendes Muster gehabt hätte, hätte ich aufgeben müssen. Der (überflüssige) Zeitaufwand steht in keinem vernünftigen Verhältnis zum Ergebnis.

500 - jetzt müssten noch alle anderen vhosts konfiuriert werden

und die Logbücher der letzten 24 Monate rückwärts aufgedröselt und integriert werden. Das wird auch noch mühsam werden.

 

Es ist auch sinnvoll, im /etc/awstats erst mal eine erste (Muster-)Domain fertig zu konfigurieren und dann diese als neuen Vorlagendummy zu verewigen

 

 

16.11.2009 um 3.30 Morgens

und wenn Sie auch damit kämpfen, und es partout nicht funktionieren will, erst mal hier einen Kommentar ablassen, ich rufe dann "Abends" zurück, Flatrate für ganz Europa im Festnetz!!


http://www.rde.net/rde-net-kommentar.html

 

 

Startseite -- © 2001/2022 - Copyright by Dipl.-Ing. Gert Redlich / Germany - D-65191 Wiesbaden - Telefon-Nummer - Impressum