Gebruik van deze manuals is uiteraard voor eigen risico, sommige zijn ook nog in ontwikkeling. Kom je iets tegen op deze wiki waar volgens jou niks van klopt? Stuur dan een mailtje naar datkloptniet at tmcr.nl
Awstats installeren
Uit TmcrWiki
Op Debian Linux
- Installeer awstats met aptitude:
aptitude install awstats
- test of het werkt door in je browser het volgende adres te openen:
http://mijnserveradres/cgi-bin/awstats.pl
als alles goed is krijg je een pagina met een awstats foutmelding: "Error: SiteDomain parameter not defined in your config/domain file. You must edit it for using this version of AWStats."
- voor we gaan configureren met het script moeten we even een paar handelingen doen anders eindigt het script met een errormelding:
mkdir -p /usr/share/doc/awstats/examples/wwwroot/cgi-bin/ gunzip /usr/share/doc/awstats/examples/awstats.model.conf.gz cp /usr/share/doc/awstats/examples/awstats.model.conf /usr/share/doc/awstats/examples/wwwroot/cgi-bin/
- run het awstats configure script voor het domein waarvoor je statistiek in wilt stellen:
cd /usr/share/doc/awstats/examples/ perl awstats_configure.pl
- doorloop het proces:
----- AWStats awstats_configure 1.0 (build 1.6) (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 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/doc/awstats/examples to standard directory: /usr/local/awstats And then, run configure.pl from this location. Do you want to continue setup from this NON standard directory [yN] ? y
-----> 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):
/etc/apache2/apache2.conf
-----> Check and complete web server config file '/etc/apache2/apache2.conf' Add 'Alias /awstatsclasses "/usr/share/doc/awstats/examples/wwwroot/classes/"' Add 'Alias /awstatscss "/usr/share/doc/awstats/examples/wwwroot/css/"' Add 'Alias /awstatsicons "/usr/share/doc/awstats/examples/wwwroot/icon/"' Add 'ScriptAlias /awstats/ "/usr/share/doc/awstats/examples/wwwroot/cgi-bin/"' Add '<Directory>' directive AWStats directives added to Apache config file.
-----> 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.mijndomein.nl
-----> 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): enter
-----> Create config file '/etc/awstats/awstats.www.mijndomein.nl.conf' Config file /etc/awstats/awstats.www.mijndomein.nl.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/share/doc/awstats/examples/wwwroot/cgi-bin/awstats.pl -update -config=www.mijndomein.nl Or if you have several config files and prefer having only one command: /usr/share/doc/awstats/examples/tools/awstats_updateall.pl now Press ENTER to continue...
A SIMPLE config file has been created: /etc/awstats/awstats.www.mijndomein.nl.conf You should have a look inside to check and change manually main parameters. You can then manually update your statistics for 'www.mijndomein.nl' with command: > perl awstats.pl -update -config=www.mijndomein.nl You can also read your statistics for 'www.mijndomein.nl' with URL: > http://localhost/awstats/awstats.pl?config=www.mijndomein.nl
- test de configuratie, ga naar
http://mijnserver//cgi-bin/awstats.pl?config=www.mijndomein.nl
- bij mij werkten sommige plaatjes nog niet, dit heb ik aangepast door het volgende blok toe te voegen aan /etc/apache2/apache2.conf:
Alias /awstatsicons/ "/usr/share/awstats/icon/" <Directory "/usr/share/awstats/icon/"> Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all </Directory>
herstart apache
apache2ctl graceful
- pas de logfile lokatie aan in het awstats configuratie bestand, deze moet wel bestaan natuurlijk. Ik stel zelf apache zo in dat iedere site eigen logfiles heeft en ik noem ze mijndomein.nl_access.log:
/etc/awstats/awstats.www.mijndomein.nl.conf
LogFile="/var/log/apache2/mijndomein.nl_access.log"
- test of je de statistieken kunt updaten:
/usr/lib/cgi-bin/awstats.pl -update config=www.mijndomein.nl
- Geen foutmeldingen? Voeg bovenstaand commando dan toe aan crontab zodat de statistieken dagelijks bijgewerkt worden
crontab -e
bv om 2 uur s'nachts:
0 2 * * * /usr/lib/cgi-bin/awstats.pl -update config=www.mijndomein.nl

