cookbook 'piwik', '= 0.2.0', :supermarket
piwik (2) Versions 0.2.0 Follow7
cookbook 'piwik', '= 0.2.0'
knife supermarket install piwik
knife supermarket download piwik
Installs piwik using nginx and php-fastcgi either on a single server or on a cluster of server for high traffic sites.
- mysql-client (to enable piwik to connect to it's MySQL server)
- runit (for managing nginx and php-fastcgi)
- nginx (the web server)
- iptables (for locking down the piwik machine)
- logrotate (for rotating nginx log files)
Debian or Ubuntu though may work where 'build-essential' works, but other platforms are untested.
All node attributes are set under the
- version - The piwik version to install (e.g. 1.5.1). It will upgrade the installation, if you change that value later
install_path - The path where the web server will expect the piwik dir to live
php_fcgi_memory_limit - The memory limit for PHP
php_fcgi_children - The number of concurrent PHP processes
php_fcgi_max_requests - Kill each PHP process after it served the given amount of requests to avoid memory bloat
php_fcgi_bind_path - The URL or socket to let nginx talk to PHP (for fastcgi's config)
php_fcgi_pass - The URL or socket to let nginx talk to PHP (for nginx's config)
The following attributes are only used by the 'piwik::slave' recipe to connect it to an existing piwik installation
- config - superuser - login - The username of the piwik superuser
- config - superuser - password - The MD5 hash of the password of the piwik superuser
- config - superuser - email - The email address of the piwik superuser
- config - superuser - salt - The salt generated by piwik on installation
- config - database - host - The database server, where the piwik DB lives
- config - database - port - The port of the database
- config - database - username - The username to connect to the database
- config - database - password - The database password
- config - database - dbname - The name of the database with the existing piwik installation
- config - database - adapter - The PHP database adapter to be used
- config - database - tables_prefix - The prefix of the existing piwik tables
- config - database - charset - The charset of the existing piwik tables
For low traffic sites
Just add 'recipe[piwik]' to your node's run list. This will download and install piwik on the host. It will ask you for superuser and database connection params when you first hit /index.php on your new piwik server.
For high traffic sites
If you run a medium to high traffic site (> 100.000 visits/day) you should use the 'piwik::master' and 'piwik::slave' recipes. The 'piwik::master' will install piwik on the host using the default recipe. You'll need to do the manual piwik configuration hitting /index.php as described above.
Additionally the 'piwik::master' recipe will install an hourly cron job to run the piwik archive.sh script to pre-calculate reports. You should disable report generation on hitting the frontend in the piwik settings.
If you want to setup a cluster of piwik tracking servers, all connected to the very same piwik DB, you can setup additional tracking servers using the 'piwik::slave' recipe. To be able to use it, go to your (manually configured) master and take all required values from piwik/config/config.ini.php and overwrite the attributes of the piwik cookbook with those values. Then a new server using the 'piwik::slave'recipe will automatically connect to the existing piwik installation. You can now use a load balancer to distribute tracking requests to all of your piwik servers.
LICENSE and AUTHOR
Author:: Matthias Marschall (email@example.com)
Copyright:: 2011, gutefrage.net GmbH
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.
|nginx >= 0.0.0|
|iptables >= 0.0.0|
|mysql >= 0.0.0|
|runit >= 0.0.0|
|logrotate >= 0.0.0|
There are no cookbooks that are contingent upon this one.