-== Setup Piwik ==
-
-Note,
-<source lang="bash">
-# based on recommendation from install page
-if ! dpkg -s php5-gd &>/dev/null; then
- apt-get install -y php5-gd
- service apache2 restart
-fi
-
-# docs suggests using separate database user
-mysql -u root -p$dbpass <<EOF
-GRANT ALL ON piwik.* TO 'piwik'@'localhost' IDENTIFIED BY '$piwik_pass';
-FLUSH PRIVILEGES;
-exit
-EOF
-php_ini=$(isdeb && echo /etc/php5/apache2/php.ini || echo /etc/php.ini)
-# based on the install page. however, ths option is changing with php7.0
-opt=always_populate_raw_post_data
-sed -ri "/^ *$opt\b/d;/^ *\[PHP\]/a $opt = -1" $php_ini
-service apache2 restart
-</source>
-
-
-''' Manual Steps'''
-
-Unfortunately, Piwik does not document how to do a fully automated install, and although it certainly seems possible, my first glance at the config file after doing manual steps showed a lot of noise, so we are sticking with the manual steps for now.
-
-In a browser, navigate to your_domain/analytics. Follow these steps [http://piwik.org/docs/installation/#the-5-minute-piwik-installation the-5-minute-piwik-installation]. Use the user/db/pass from the previous section.
-
-
-We are going to use an extension to handle the javaScript tracking tag part.
-
-Under settings -> user settings, click the cookie to exclude your current browser.
-
-
-''' [[mediawikiwiki:Extension:Piwik Integration|Extension:Piwik Integration]] '''
-
-<source lang="bash">
-git clone https://github.com/DaSchTour/piwik-mediawiki-extension.git $mw/extensions/Piwik
-mw-ext Piwik
-teeu $mwc <<EOF
-\$wgPiwikURL = '$mwdomain/analytics/';
-\$wgPiwikIDSite = '1';
-EOF
-</source>
-
-
-'''If this is not the first site you setup'''
-
-You will need to adjust the previous $wgPiwikIDSite variable. The correct value can be found in the Piwik javaScript tracking tag code, in the line that looks like <code>_paq.push(['setSiteId', 2]);</code>
-
-'''Updates'''
-
-Based on [http://piwik.org/docs/update/ piwik.org/docs/update]. Previously it's been seen to require manual steps, so it is not recommended to put in a cron script.
-
-<source lang="bash" type="example">
-mkdir -p ${s%/*}
-piwik_path=$mw/../analytics
-cd "$(mktemp -d)"
-wget -q http://builds.piwik.org/piwik.zip
-unzip -q piwik.zip
-rm -f piwik.zip
-cp $piwik_path/config/config.ini.php piwik/config
-cp -rf piwik/* $piwik_path
-# prevent making an email out of the standard success response
-$piwik_path/console core:update
-</source>
-
-
-''' Skippable Notes '''
-
-Piwik docs say use a subdir or a subdomain. googling finds a page which suggests using a subdomain, for more logical separation https://library.linode.com/web-applications/analytics/piwik/centos-5. However, mediawiki doesn't use the root dir of the web server, so the analytics folder can't mess things up by existing there, and it doesn't have any crazy virtualhost settings which might conflict, so there is no need. Plus we get ssl for free by sharing the same domain.
-
-The docs also say: "When you have finished configuring Piwik, you can set more restrictive permissions (ie. read only) to the “piwik/config/” folder. Piwik will always write its data inside the “piwik/tmp/” folder, so this is the only folder that requires write permissions."