In ISPmanager you can collect statistics of user requests to websites. To do so you can use the following features:
On the WWW-domain add or edit from enable the options Access log and Error log and specify their parameters:
To view the log go to Web-server settings → WWW-logs.
To view the reports go to Domains → WWW-domains → Statistics. Statistics for a WWW-domains is kept in /var/www/
Rotation is used to archive the logs so that they occupy less disk space. logrotate is a utility that is used for log rotation. The cron job /etc/cron.daily/logrotate starts the utility every day.
The rotation global settings are kept in the configuration file /etc/logrotate.conf.
Rotation parameters of WWW-domains are kept in the configuration files /etc/logrotate.d/web/
Configuration file of the WWW-domain log
/var/www/httpd-logs/<WWW-domain name>.access.log {
olddir /var/www/<WWW-domain owner>/data/logs
rotate 65530
size=16M
copytruncate
compress
<rotation period>
prerotate
/etc/webanalyzer.d/<WWW-domain owner>/<WWW-domain name>
endscript
}
/var/www/httpd-logs/<WWW-domain name>.error.log {
olddir /var/www/<WWW-domain owner>/data/logs
copytruncate
compress
<rotation period>
}
Execute the command:
/usr/sbin/logrotate -d -f <path to the logrotate configuration file of a WWW-domain>
Execute the following command to start rotation for all WWW-domains:
/usr/sbin/logrotate -f /etc/logrotate.conf
The result may be the error "log does not need rotating" meaning that the rotation operation failed as it was already made that day. To run the rotation change the status of the last rotation for the WWW-domain in the file /var/lib/logrotate/logrotate.status.
Enabling the log analyzer for a WWW-domain creates the configuration file in /etc/awstats/awstats.
If you have selected "during rotation" in the Period field the analyzer will start by the logrotate utility. The following strings will be added into the configuration file /etc/logrotate.d/web/
Configuration file of the WWW-domain log
prerotate
/etc/webanalyzer.d/<WWW-domain owner>/<WWW-domain>
If the Period is "every hour" the statistics collection script will be added into the user cron:
Cron jobs
# crontab -u username -l
MAILTO=""#
#ISPmanager log rotate <WWW-domain>
0 * * /etc/webanalyzer.d/<WWW-domain owner>/<WWW-domain>
Execute the command:
/etc/webanalyzer.d/<WWW-domain owner>/<WWW-domain>
To delete the error log, enter Web-server Settings → WWW logs → select the log → press Clear → OK.
Deleting the query log from the control panel interface is not supported. This is to ensure that logs are rotated correctly. If you need to delete the query log for a domain, run the following command on the server with ISPmanager:
echo "" > /var/www/httpd-logs/<WWW domain>.access.log