DEPRECATION WARNING
This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.
EXT: AWStats¶
Author: | Kasper Skårhøj |
---|---|
Created: | 2002-11-01T00:32:00 |
Changed: | 2012-06-30T17:01:17 |
Classification: | xf_awstats |
Keywords: | awstats, forAdmins, forIntermediates |
Author: | Xaver Maierhofer |
Email: | xaver.maierhofer@xwissen.info |
Info 4: | |
Language: | en |
EXT: AWStats - xf_awstats -
EXT: AWStats¶
Extension Key: xf_awstats
Language: en
Keywords: awstats, forAdmins, forIntermediates
Copyright 2000-2010, Reto Zahner, <reto.zahner@newmedia.ch>Copyright 2012, Xaver Maierhofer, <xaver.maierhofer@xwissen.info>
This document is published under the Open Content License
available from http://www.opencontent.org/opl.shtml
The content of this document is related to TYPO3
- a GNU/GPL CMS/Framework available from www.typo3.org
Table of Contents¶
`Introduction 3 <#__RefHeading__871_27623931>`_
`Users manual 4 <#__RefHeading__877_27623931>`_
`Administration 5 <#__RefHeading__879_27623931>`_
The extension configuration parameters 5
The TYPO3 logfile functionality 5
Install the Update cronjob awstats-update.phpcron 5
`Configuration 8 <#__RefHeading__909_27623931>`_
`FAQs 9 <#__RefHeading__911_27623931>`_
`Additional Information 10 <#__RefHeading__913_27623931>`_
`Changelog 11 <#__RefHeading__915_27623931>`_
Introduction¶
This extension is a fork from ics_awstats and is ics_awstats heavily based on cc_awstats by René Fritz. There are some more features in this extension.
Here are some other Add-ons:
- cronscript for updating the statistics
- allow/disallow updating the statistics from browser
- optional reverse DNS lookups
- performing one of the following actions after update: PurgeLogFile or ArchiveLogRecords
- possibility to configure the location of the perl binary
- possibility to disable the cache clearing via the extension configuration
- possibility to enable AWStats Plugin DecodeUTFKeys
- possibility to enable AWStats Plugin GeoIP
What does it do?¶
This extension integrates the third party software AWStats into TYPO3 as backend module. The extension includes a module for administrators. Externally generated log files can be configured to be analyzed by AWStats like the TYPO3 generated ones.
From http://awstats.sourceforge.net/ :
“ AWStats is a *free powerful and featureful tool that generates advanced web, streaming, ftp or mail server statistics, graphically* . This *log analyzer* works as a *CGI or from command line* and shows you all possible information your log contains, in *few graphical web pages* . It uses a partial information file to be able to process large log files, often and quickly. It can analyze log files from all major server tools like Apache log files (NCSA combined/XLF/ELF log format or common/CLF log format), WebStar, IIS (W3C log format) and a lot of other web, proxy, wap, streaming servers, mail servers and some ftp servers.”
Users manual¶
There is nothing for non-admin users in this extension.Use the xf_web_awstats extension to provide the AWStats statistics to non- admin backend users or groups.
Administration¶
The 'AWStats' Logfile Analyzer uses the perl language interpreter. You must install this application.
The extension configuration parameters¶
Path to perl executable¶
Label
Path to perl executable
(perlbin)
Data type
string
Description
Enter here the full path to the perl binary including the binary itself (e.g. /usr/bin/perl on Linux or C:Perlbinperl.exe on Windows).
Please consult the FAQs if you use Windows with a path containing whitespaces.
Default
/usr/bin/perl
Disable AWStats cache clearing¶
Label
Disable AWStats cache clearing
(disableClearCache)
Data type
boolean
Description
It is not possible to delete the AWStats cache if you set this option. The 'Clear cache' button will disappear.
Default
false
Enable Plugin DecodeUTFKeys (enableDecodeUTFKeys)¶
Label
Enable Plugin DecodeUTFKeys (enableDecodeUTFKeys)
Data type
boolean
Description
Allow AWStats to show correctly (in language charset) keywords/keyphrases strings even if they were UTF8 coded by the referer search engine. (Perl modules required: Encode and URI::Escape)
Default
false
Enable Plugin GeoIP (enableGeoIP)¶
Label
Enable Plugin GeoIP (enableGeoIP)
Data type
boolean
Description
Country chart is built from an Internet IP-Country database. This plugin reduces AWStats speed of 8%. (Perl modules required: Geo::IP or Geo::IP::PurePerl)
Default
false
Path to GeoIP.dat (pathToGeoIPDat)¶
Label
Path to GeoIP.dat (pathToGeoIPDat)
Data type
string
Description
Path to the GeoIP.dat file. This value will only take effect if you enable the GeoIP plugin.
Default
/usr/share/GeoIP/GeoIP.dat
The TYPO3 logfile functionality¶
If you didn't used the logfile functionality yet, you have to configure it.First put in localconf.php or use the Install-Tool:
$TYPO3_CONF_VARS["FE"]["logfile_dir"] = 'fileadmin/log/';
This is the path where TYPO3 should write webserver-style logfiles to.This path must be write-enabled for the webserver!
Now enable logfile writing in your template with TypoScript:
## Enable apache-style logging into a file
config.stat = 1
config.stat_apache = 1
config.stat_apache_logfile = log.txt
## Optional: Simulate Static Document
config.simulateStaticDocuments = 1
config.simulateStaticDocuments_addTitle = 30
config.stat_apache_pagenames = /[title].[uid].[type].html
Remember to make it writable for the webserver.
Remark: In TYPO3 it is possible to use date markers in the filename, as per the PHP function strftime(). This will enable a natural rotation of the logfiles. For example, typo3_%Y%m%d.log will create daily log files. The current version of xf_awstats does NOT support this functionality! So do NOT use this feature if you use xf_awstats! Check out the 'Archive logrecords'-feature of xf_awstats if you want something like this.
Install the Update cronjob awstats-update.phpcron¶
You can use a Cronjob entire, it is working, but prefer scheduler task in backend . You need to setup a Cronjob on your TYPO3 installtion and you can control all tasks!
when installed as local extension:15 3 * * * /.../typo3conf/ext/xf_awstats/mod1/awstats-update.phpcron
when installed as global extension:15 3 * * * /.../typo3/ext/xf_awstats/mod1/awstats-update.phpcron
Note:
- the absolute path to the script must be specified.
- check if awstats-update.phpcron is executable. If not do a 'chmod a+x awstats-update.phpcron'
- the cronjob has to be run under the same user as the webserver.
- awstats-update.phpcron is a shell script and requires the availability of a PHP binary, "/usr/bin/php”. Depending on your server configuration, you may have to edit the first line of the script referring to the location of the PHP binary. Another possibility is to call awstats-update.phpcron as parameter of the PHP binary; like e.g. this:15 3 * * * /path/to/php /.../typo3conf/ext/xf_awstats/mod1 /awstats-update.phpcron
only the logfiles configured with 'Cron update' will be analyzed.
Install the Scheduler Task¶
Prerequisites¶
- scheduler extension
- Add cron job to invoke the scheduler (typo3/cli_dispatch.phpsh scheduler)
Add AWStats-Task¶
1) Open the scheduler and display the scheduled tasks.2) Click the the “Add task” link to open the “Add Task” form.3) Select the AWStats- Task.4) Enter the frequency. You can use the same time settings as described in the section Install the Update cronjob awstats- update.phpcron
Important : Only the logfiles configured with 'Cron update' will be analyzed.
Debugging¶
In some server environments there are problems to get xf_awstats run. Because the module is a wrapper for a perl script (AWStats itself) it's a bit hairy to make the module work.
For those people who have problems there's a debug mode in this extension. If the AWStats script fails for some reason the debug output will be shown automatically. But you can force the module to show debug output if it's needed:
Open the logfile link in a new window (with shift-click, or a right click option). You see the url in your new browser window. Something like that:
...index?t3log=foo.log
add '&dbg=1' to the url:
...index?t3log=foo.log&dbg=1
That should bring some debug output. Maybe that helps you. Otherwise save the page and send it to me with a description if you have a special server or a special setup.
Configuration¶
Inside the TYPO3 backend you will be asked the following attributes per logfile:
Logfile¶
Label
Logfile
Data type
string (not editable)
Description
Name of the logfile (will automatically scanned from $TYPO3_CONF_VARS["FE"]["logfile_dir"])
The logfiles have to be named *.log or *log*.txt
examples: my-domain.log, logfile.txt, website-log.txt
Default
Domain(s)¶
Label
Domain(s)
Data type
string
Description
Domain(s) for which the logfile is/are.
For multiple domains seperate them with komma. The main domain first.
example: www.mydomain.com,mydomain.com,sub.mydomain.com
You can hide files with - (minus)
Default
empty string
Browser update¶
Label
Browser update
Data type
boolean
Description
Whether the statistic is updateable via webbrowser or not
Default
true
Cron update¶
Label
Cron update
Data type
boolean
Description
Whether the statistic will be updated via the awstats-update.phpcron process or not.
Default
false
Reverse DNS Lookups¶
Label
Reverse DNS Lookups
Data type
boolean
Description
Whether you want to have hosts reported by name instead of ip address.Caution: This feature will reduce dramatically AWStats update process speed. Do not use on large web sites.
Note : Result of DNS Lookup can be used to build the Country report. However it is highly recommended to enable the GeoIP plugin to have an accurate Country report with no need of DNS Lookup.
Default
false
Action after updating¶
Label
Action after updating
Data type
enum('n','p','a'); it's a simple selectbox
Description
Whether AWStats will perform an action after updating the statistic. Following actions are implemented:
None [n]: no action will be performed
Purge Logfile [p]:
the logfile will be purged by AWStats after updating (see also the PurgeLogFile feature of AWStats)
Archive Logrecords [a]:
AWStats will keep archive files of all processed logs (see also the ArchiveLogRecords feature of AWStats). You will find the archive files in $TYPO3_CONF_VARS["FE"]["logfile_dir"]/.awstats- data/<logfilename>/
The archive filenames are of the following form:
awstats_archive.%MM%YYYY.log
(where %MM is the month and %YYYY the year)
Be aware: this action implies purging the logfile
Default
None [n]
FAQs¶
There are a lot of problems with perl. Here are some possible solutions:
- General problems: try the debug mode (see chapter debugging)
- If debug mode doesn't help: try to run it in a shell. Don't forget to set the AWS_* environment variables in this shell.
- This extension does not work with perl version 5.8.0. Upgrade your perl Installation.
- AWStats requires at least perl version 5.00503 (5.5.30) or higher. Upgrade your perl Installation.
- Error "Insecure dependency in require while running setuid at ...” appears: Append to the path of the perl executable the -U option; e.g perlbin=/usr/bin/perl -U