Create/Update database for config "/etc/awstats/awstats.smtp.conf" by AWStats version 7.4 (build 20150714)From data in log file "perl /usr/share/awstats/tools/maillogconvert.pl standard Phase 1 : First bypass old records, searching new record...Searching new records from beginning of log file...Jumped lines in file: 0Parsed lines in file: 2 Found 0 dropped records, Found 0 comments, Found 0 blank records, Found 0 corrupted records, Found 2 old records, Found 0 new qualified records.[root@povej cgi-bin]#
when I rund this it creates index.html and it shows all statistics for postfix /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=smtp -output -staticlink > /usr/share/awstats/wwwroot/index.html
– postfix Log awstats
Once the installation is done, proceed to set it up to analyze your web logs. Upon installation, AWStats files are placed in /usr/local/awstats directory.A default configuration file for AWStats is installed as /etc/awstats/awstats.model.conf.Create a copy of this configuration file and modify it for the analysis of your domain logs.
This creates a copy of the main configuration file with the FQDN of your server;ls /etc/awstats/awstats.centos8.kifarunix-demo.com.conf awstats.model.confNext, open your configuration file for editing.vim /etc/awstats/awstats.centos8.kifarunix-demo.com.confDefine the path to the Web server log file to analyze. In this case, we will be using the default Apache access log file.
In order to be able to view the statistics generated above on the browser, you need to create an Apache configuration file to define how to process and server the AWStats.Create AWStats configuration file;if(typeof ez_ad_units!='undefined')ez_ad_units.push([[336,280],'kifarunix_com-leader-2','ezslot_17',111,'0','0']);__ez_fad_position('div-gpt-ad-kifarunix_com-leader-2-0');vim /etc/httpd/conf.d/kifarunix-demo-awstats.confWithin the configuration file, you need to define the location of the AWStats CGI/perf configuration files as the root directory.
Update your statistics;/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -config=centos8.kifarunix-demo.com -updateView Apache Access Log Statistics on BrowserYou can now view your AWStasts on browser via the URL you created the AWStats config file with the hostname, e.g, /etc/awstats/awstats.centos8.kifarunix-demo.com.conf, then you need to use the same hostname on the url as in -demo.com/awstats/awstats.pl. If you used IP address, then ensure your url is using an IP address. Otherwise, specify the configuration file using =config-name, where config-name can be the hostname or IP address specified on the AWStats configuration file.
And there you go. You can now create a cron job to keep updating your site statistics at a specific interval. For example, to have your site stats updated every 30 mins, install a cron job like as shown below;sudo crontab -e*/30 * * * * /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -config=centos8.kifarunix-demo.com -updateSave and install the cron job. You should now have your site stats updated every 30 mins.That marks the end of our guide on how to install and setup AWStats Log Analyzer on CentOS 8.
If you want reports on the mail and/or users then you need to search through the postfix log file to get information about mail flow and numbers. You could also set-up a log server, there was a recent competition in these forums on the subject, take a look at what you can do with that.
Edit the /etc/awstats/awstats.conf.local file and not the master configuration file. The main awstats.conf file is a good reference for all the configuration options, of which there are plenty.
The above configuration will actually from now on require a password for all your cgi scripts dwelling under /usr/lib/cgi-bin, so if you have something there you wish not to protect, move the awstats.pl to somewhere else and secure that instead.
Comme le serveur apache2 fonctionne en environnemnt chrooté, awstats ne peux pas être installé en tant que script CGI, (Perl n'est pas présent dans le chroot). Il sera donc installé en dehors, avec une génération de pages statiques accessibles par le serveur Apache.
Exemple de 2 files postfix: une pour le système et l'autre pour un service quelconque, nommées respectivement postfix et postfix-service. Les 2 instances génères des logs dans le fichier /var/log/mail.log .
Look for your DataDir of your website and remove the particular month of the file. In our case, we are using Virtualmin that installs the AWStats and by default the DataDir of the site is stored in /var/www/awstats/[site-domain]. For example, if the site domain is gix.my, the directory that stores all the AWstats data files would be in /var/www/awstats/gix.my. You may want to backup that folder first before you start to do anything with the files. Make sure that you have the old log files that needs to be processed by AWStats.
Let's say for example the current month is March 2013, but you wish to process the statistics data for the month of February 2013. One thing about AWStats is that if you wish to process previous months, you will need to remove starting from the current month. In this case, we will need to remove both March and February 2013 data file. The format of how AWStats save its data is awstatsMMYYYY.[site-domain].txt. With that being said, you need to remove awstats032013.gix.my.txt and awstats022013.gix.my.txt.
This is what every forum and guide didn't mention based on our research - you will need to create an empty awstatsMMYYYY.[site-domain].txt file of the particular month. Otherwise AWStats will report that the older logs that you processed are old records and will not be added to your statistics database.
# First we need to setup our DATADIR; this is where# all our statistics and generated data will be placed# into:[ ! -d $DATADIR/static ] && \mkdir -p $DATADIR/staticln -snf /usr/share/awstats/wwwroot/icon \$DATADIR/static/iconln -snf /usr/share/awstats/wwwroot/cgi-bin \$DATADIR/static/cgi-bin
# Create a configuration file using our website# based on the awws.model.conf example file that# ships with AWStatssed -e "slocalhost\.localdomain$WEBSITEg" \/etc/awstats/awstats.model.conf > \/etc/awstats/awstats.$WEBSITE.conf
######################################### Now update our new configuration######################################### Update the LogFile with our access.log file we'll# reference. This path doesn't exist yet but# we'll be creating it soon enough; leave this entry# untouched (don't change it to your real log path!):sed -i -e "s^\(LogFile\)=.*$\1=\"$DATADIR/access.log\"g" \/etc/awstats/awstats.$WEBSITE.conf
# For PDF Generation we need to update the relative# paths for the icons.sed -i -e "s^\(DirIcons\)=.*$\1=\"icon\"g" \/etc/awstats/awstats.$WEBSITE.confsed -i -e "s^\(DirCgi\)=.*$\1=\"cgi-bin\"g" \/etc/awstats/awstats.$WEBSITE.confsed -i -e "s^\(LogFormat\)=.*$\1=\"%host %other %logname %time1 %methodurl %other %other %code %bytesd %refererquot %uaquot %other %other\"g" \/etc/awstats/awstats.$WEBSITE.conf
Update GEOIP (Optional)# Now configure our GEOIP Setupsed -i -e '/^LoadPlugin=.*/d' /etc/awstats/awstats.$WEBSITE.confcat > /etc/awstats/awstats.$WEBSITE.confLoadPlugin="geoip GEOIP_STANDARD /usr/share/GeoIP/GeoIP.dat"LoadPlugin="geoip_city_maxmind GEOIP_STANDARD /usr/share/GeoIP/GeoIPCity.dat"_EOF
WEBSITE=domain.comDATADIR=/var/lib/awstats/$WEBSITE/usr/share/awstats/tools/logresolvemerge.pl /data/nginx/logs/access.log > $DATADIR/access.log/usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=$WEBSITE/usr/share/awstats/tools/awstats_buildstaticpages.pl -config=$WEBSITE -buildpdf -dir=$DATADIR/static -buildpdf=/usr/bin/htmldoc
La programación a intervalos de la lectura de logs mediante cron es también idéntica a la vista en el anterior artículo, pero en este caso crearemos un fichero sh independiente del que ya teníamos para luego usarlo también en la rotación de logs del servidor de correo. En mi caso lo he llamado /etc/awstats/cron-awstats-mail.sh y contiene las siguientes líneas: 2ff7e9595c
Comments