Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Installs awstats and provides an LWRP to configure statistics for your domain

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 attributes
Octocat-spinner-32 files
Octocat-spinner-32 providers
Octocat-spinner-32 recipes
Octocat-spinner-32 resources
Octocat-spinner-32 templates
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 metadata.rb
README.md

chef_cookbook-awstats Build Status

Description

This cookbook installs awstats and provides an LWRP to setup awstats for a service of your choice.

Requirements

Currently only Debian 6+ (and probably Ubuntu) is supported.

Depends on

  • apache2
  • htpasswd

Attributes

LWRP

domain_statistics

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.

Attribute Description Default Value
domain_name Name attribute:The domain name to be processed by awstats nil
log_location The directory containing the webserver's log files for the domain. /var/log/apache2/access.log
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. [[WHITESPACE]]
dns_lookup Option to enable, disable or make DNS lookups static. Possible values are 0 (nope), 1 (YIP) and static (static YIP). 1
host_alias Aliases for the domain_name localhost 127.0.0.1
skipped_hosts Array of hosts to be skipped when generating the statistics [ "127.0.0.1", "localhost" ]
cron_minute The interval in minutes defining how often the cronjob for generating statistics gets executed */15 (every 15 minutes)
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

Usage

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

Development

Pull requests are very welcome! Make sure your patches are well tested. Ideally create a topic branch for every separate change you make.

License and Author

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

http://www.apache.org/licenses/LICENSE-2.0

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.

Something went wrong with that request. Please try again.