You are browsing a read-only backup copy of Wikitech. The live site can be found at wikitech.wikimedia.org
Nova Resource:Wikistats/Documentation
Wikistats
Description
A project that collects and displays statistics for Mediawikis.
Purpose
Collecting statistics about Mediawiki installs on the internet.
Anticipated traffic level
10-100 hits per day
Anticipated time span
indefinite
Project status
currently running
Contact address
dzahn@wikimedia.org
Willing to take contributors or not
willing
Subject area narrow or broad
narrowstatistics
http://wikistats.wmcloud.org
Where to find the code
Wikistats consists of 2 parts, the puppet manifests (in the operations/puppet git repo) and the Debian package (in the operations/debs/wikistats repo).
The puppet part is divided into ./puppet/modules/role/manifests/wikistats/instance.pp,the role class which is applied to a node/instance, and the module in ./puppet/modules/wikistats/.
Manifests
- role::wikistats - configures host name and SSL certs depending on labs vs. prod, uses the main classes below, is all that needs to be included on an instance or node
- wikistats - the init.pp of the module, sets up user/group, installs package (if we're using labsdebprepo), uses the other classes
- wikistats::cronjob - defines a cron job to update a table
- wikistats::db - installs mariadb, php-mysql
- wikistats::updates - installs php-cli, creates log dir, has definitions for the update cron jobs and configures them
- wikistats::web - does the Apache setup
(Currently they do not automatically install the package yet which is done manually)
How to build the Debian package
- git clone https://gerrit.wikimedia.org/r/operations/debs/wikistats
- cd wikistats
- "debuild" (signed) or "debuild -us -uc" (unsigned)
- cd ..
- optional: check which files would be installed by this: dpkg-deb -c wikistats_*_all.deb
- install: dpkg -i wikistats_*_all.deb
^ This is outdated. It's still in this repo but not an actual .deb anymore. Just git pull the files or let the deploy-wikistats command do that for you.
How to deploy latest code
- /usr/local/bin/wikistats# ./deploy-wikistats deploy
Optionally use "backup" to make a backup of current code before deploying or "restore" to restore from the last backup.
- /usr/local/bin/wikistats# ./deploy-wikistats backup
- /usr/local/bin/wikistats# ./deploy-wikistats restore
How to fix DB grants if they break after deploy
grep db_pass /etc/wikistats/config.php mysql -u root -p wikistats mysql> grant all privileges on wikistats.* to 'wikistatsuser'@'localhost' identified by '<password from config.php>';