This is a simple way to analysis the apache (webserver) log in a full graphic web page.
This is a simple way to analysis the postfix / zimbra log in a full graphic web page.
Install docker in your awstat host server.
Create a copy of "awstats.linoxide.conf". We have taken "example.com" as domain.
cp -av awstats.linoxide.conf awstats.example.com.conf
Change the following details according to the need in "awstats.example.com.conf".
#LogFile="/example.com.access.log"
LogFile="/var/log/apache2/example.com.access.log"
SiteDomain="example.com"
HostAliases="example.com www.example.com"
Change the following details according to the need in "mycron".
Replace :
01 * * * * /usr/lib/cgi-bin/awstats.pl -config=nroer -update
With :
01 * * * * /usr/lib/cgi-bin/awstats.pl -config=example.com -update
Change the following details according to the need in "docker-compose.yml".
Change dir name and file name as domain name also change access log name and uncomment it:
# - /logs/example.com/access.log:/root/example.com/access.log # Change domain name as dir name and access log name
# - ./awstats.example.com.conf:/usr/lib/cgi-bin/awstats/awstats.example.com.conf # Change domain name as file name in conf
Build your image incase you have changed Dockerfile:
bash build-docker-image.sh
If your log is saved in the path: /var/log/mail.log, and you can mount this file to the awstats server for analysis use.
docker run -d --name awstats --hostname ServerName \
-v /var/log/mail.log:/var/log/mail.log \
-v /path/to/your.conf:/usr/lib/cgi-bin/awstats/awstats.linoxide.conf && \
-p 8080:80 mrunal/awstats:7.6
In this command, you will also run your server into host port 8080.
The docker-compose.yml
is a file example to run container with docker-compose up
http://your-awstats-ip-addr:8080/cgi-bin/awstats/awstats.pl?config=linoxide
https://github.com/linkerlab/awstats - For basic awstats installation and configuration
https://github.com/marcelofmatos/awstats_postfix - For docker-compose.yml file
Thanks to linkerlab