xima / xm-goaccess
Integrates goaccess.io into TYPO3
Installs: 7 497
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 6
Forks: 1
Open Issues: 2
Type:typo3-cms-extension
Requires
- php: ^8.0
- typo3/cms-core: ^11.5 || ^12.0
- typo3/cms-dashboard: ^11.5 || ^12.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.3
- helhum/typo3-console: ^8.1
- phpmd/phpmd: ^2.6.0
- phpstan/phpstan: ^1.6
- squizlabs/php_codesniffer: ^3.4
- typo3/cms-base-distribution: ^12.0
- vimeo/psalm: ^4.0
This package is auto-updated.
Last update: 2024-11-16 18:28:32 UTC
README
Goaccess is an open source log analyzer which extracts metrics from a multitude of web log formats and visualizes them in your terminal or as html. Metrics can be exported to json and csv. This TYPO3 extensions ships Dashboard widgets and a backend module to display various goaccess.io metrics.
Installation
composer require xima/xm-goaccess
- Install and configure goaccess to generate json and/or html output to a directory
- Make sure the webserver user has read access to the generated files
Configuration
To enable the backend module, set the path to the generated html via extension configuration:
$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['xm_goaccess']['html_path] = '/tmp/goaccess/goaccess.html';
To make the new dasboard widgets work, you need to pass the path to the generated json file:
$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['xm_goaccess']['json_path] = '/tmp/goaccess/goaccess.json';
Usage
You can add single widgets to your custom dashboard or use the preset that creates a new dashboard with all available goaccess integrations.
Goaccess installation on Debian/Ubuntu:
The application is written in go and available from the standard repositories of multiple Linux distributions. A repository for Debian/Ubuntu is also provided. See the [official goaccess.io documentation[(https://goaccess.io/get-started) for a complete guide.
apt install goaccess
HTML and JSON exports for the TYPO3 extension can be generated from Apache logs as follows:
usr/bin/zcat --force /var/log/apache2/access_example.org.log* | \ # You usually want to parse rotated and gzipped logs as well.
/usr/bin/goaccess -
-o goaccess.html -o goaccess.json \ # Export processed metrics as html and json.
--log-format=COMBINED \ # Apache Combined Log Format. Custom log formats are supported, too.
--ignore-crawlers \ # Ignore web crawlers.
--exclude-ip ::1 --exclude-ip 127.0.0.1 \ # Exclude status checks originating from local ip addresses.
To refresh these files periodically, you might use a cronjob, e.g.:
*/15 * * * /usr/bin/mkdir -p /tmp/goaccess; chmod 750 /tmp/goaccess; /home/user/goaccess-generation.sh