This cookbook installs awstats and provides an LWRP to setup awstats for a service of your choice.
Currently only Debian 6+ (and probably Ubuntu) is supported.
Those are the attributes that can be configured with the LWRP. For more detailed explanations consult the awstats log file under templates/default or the official documentation.
|domain_name||Name attribute:The domain name to be processed by awstats||
|log_location||The directory containing the webserver's log files for the domain.||
|log_type||Type of log. Possible values are web, stream, mail and ftp.||web|
|log_format||Type of log format. Possible values are combined, iis, webast, common and custom.||combined|
|log_seperator||Type of log seperator.||
|dns_lookup||Option to enable, disable or make DNS lookups static. Possible values are 0 (nope), 1 (YIP) and static (static YIP).||
|host_alias||Aliases for the domain_name||
|skipped_hosts||Array of hosts to be skipped when generating the statistics||
|cron_minute||The interval in minutes defining how often the cronjob for generating statistics gets executed||
|cron_hour||The interval in hours defining how often the cronjob for generating statistics gets executed||
|cron_day||The interval in days defining how often the cronjob for generating statistics gets executed||
|cron_month||The interval in months defining how often the cronjob for generating statistics gets executed||
|cron_weekday||The interval in weekdays defining how often the cronjob for generating statistics gets executed||
|cron_user||The user in whose context the cronjob gets executed||root|
|cron_contact||The user that gets notified via E-Mail if the cronjob fails for some reason (it's presumed that SMTP is properly configured)||root|
recipe[awstats] makes sure to install the latest awstats package on your distribution. The LWRP can then be used to configure domain-specific statistics.
You then can enable awstats statistics and a proper htpasswd in your application-specific cookbook like this:
awstats_domain_statistics 'example.com' do log_location '/var/log/apache2/example.com-access.log' end htpasswd '/etc/apache2/htpasswd_awstats' do user 'fooforge' password 'egrofoof' end
Pull requests are very welcome! Make sure your patches are well tested. Ideally create a topic branch for every separate change you make.
Author:: Mike Adolphs
Copyright 2012, Mike Adolphs
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.