webalizer cookbook and definition for chef from opscode
Posted by Edmund Haselwanter on Tuesday, October 13, 2009
Install and run the webalizer with Chef from Opscode
http://github.com/ehaselwanter/cookbooks/tree/COOK-195/webalizer
As DRY as possible ;-)
What it is for
Simply put it derives the log file name from its name and takes a server name for where to access the output of webalizer.
How to use it
The simplest use case is
1 2 webalizer "your.example.com" do 3 server_name "stats.example.com" 4 end
This looks for a access log file in
#{node[:apache][:log_dir]}/your.example.com-access.log
und puts the webalizer results (/etc/cron.daily/00-weablizer must be run either manually or from cron)
in
/var/www/usage/your.example.com
accessable through
http://stats.example.com/your.example.com
options are
1 2 webalizer "your.example.com" do 3 server_name "stats.example.com" # custom server name 4 conf_template "webalizer.conf.erb" # custom webalizer config 5 site_template "webalizer.site.erb" #custom webalizer apache file 6 cron_schedule :daily # node[:webalizer][:cron_base_prefix]}#{params[:cron_schedule].to_s must be a cron directory 7 log_type :clf # :clf :ftp or :squid 8 cookbook "webalizer" were the templates reside 9 end 10