MediaWiki
Jump to navigation
Jump to search
General
Setup
Nginx
- Manual:Short URL/wiki/Page title -- nginx rewrite--root access
- Manual:Short URL/Page title - nginx, Root Access, PHP as a CGI module
Upgrade
- http://www.mediawiki.org/wiki/News - release info
- http://www.mediawiki.org/wiki/Manual:Upgrading
- http://www.mediawiki.org/wiki/Manual:Update.php
Download latest, extract on-top of current. Be careful with overwriting if you have hacked a core theme.
tar xvzf mediawiki-1.19.1.tar.gz -C . --strip-components=1 php maintenance/update.php
Upgrade requires DB user grants for: select, insert, update, delete, alter, index
http://www.mediawiki.org/w/api.php?action=expandtemplates&text=http://download.wikimedia.org/mediawiki/{{MW%20stable%20branch%20number}}/mediawiki-{{MW%20stable%20release%20number}}.tar.gz
Backup
change vars;
nice -n 19 mysqldump -u $USER --password=$PASSWORD $DATABASE -c nice -n 19 gzip -9 > wiki-$DATABASE-$(date '+%Y%m%d').sql.gz
Script
- http://serom.no-ip.org/index.php/Backup_du_SeRoM_Wiki - bash script, send backup to remote
- https://github.com/milkmiruku/backup-mediawiki
- https://github.com/milkmiruku/backup-mediawiki-remote
Compress
Configuration
- http://www.mediawiki.org/wiki/Manual:Configuration
- http://www.mediawiki.org/wiki/Manual:System_administration
- https://en.wikipedia.org/wiki/MediaWiki_extension
- http://www.mediawiki.org/wiki/How_to_become_a_MediaWiki_hacker
Caching
$wgMainCacheType = CACHE_ACCEL; PHP acceleration, i.e., APC
php purgeList.php --all
- https://www.mediawiki.org/wiki/Extension:Purge - extension adds a purge tab on all normal pages, allowing for quick purging of the cache.
Usage
Markup
{| class="wikitable" |- ! Header 1 ! Header 2 ! Header 3 |- | row 1, cell 1 | row 1, cell 2 | row 1, cell 3 |- | row 2, cell 1 | row 2, cell 2 | row 2, cell 3 |}
Hotkeys
Content
Interwiki
Categories
Theming and frontend
- http://www.mediawiki.org/wiki/Manual:Skinning/Tutorial
- http://blog.redwerks.org/2012/02/28/mediawiki-subskin-tutorial/
Toolbox
A mess. Hack SkinTemplate.php
MediaWiki:Privacy MediaWiki:Aboutsite MediaWiki:Disclaimers
Layout
Social
Content
WYSIWYM
- https://www.mediawiki.org/wiki/Extension:VisualEditor
- https://www.mediawiki.org/wiki/VisualEditor - for WikiText markup based RDFa, linked with Parsoid wikitext parer project
Real-time
Print.css
Users
Signup
- https://www.mediawiki.org/wiki/Extension:ConfirmAccount
- https://www.mediawiki.org/wiki/Extension:InviteSignup
Login
- http://www.mediawiki.org/wiki/Extension:WPMW - wordpress auth bridge
- https://www.mediawiki.org/wiki/Extension:SecureSessions
- https://www.mediawiki.org/wiki/Extension:SSLClientAuthentication
Permissions
- Special:UserRights - User rights management
- http://www.mediawiki.org/wiki/Manual:User_rights
- http://www.mediawiki.org/wiki/Manual:$wgDefaultUserOptions
- https://www.mediawiki.org/wiki/Extension:Page_access_restriction
- https://www.mediawiki.org/wiki/Extension:Restrict_access_by_category_and_group
- https://www.mediawiki.org/wiki/Extension:EditSubpages
Namespace protection
# Only allow autoconfirmed users to edit Project namespace $wgNamespaceProtection[NS_PROJECT] = array( 'autoconfirmed' ); # Don't allow anyone to edit non-talk pages until they've confirmed their # e-mail address (assuming we have no custom namespaces and allow edits # from non-emailconfirmed users to start with) # Note for 1.13: emailconfirmed group and right were removed from default # setup, if you want to use it, you'll have to re-enable it manually $wgNamespaceProtection[NS_MAIN] = $wgNamespaceProtection[NS_USER] = $wgNamespaceProtection[NS_PROJECT] = $wgNamespaceProtection[NS_IMAGE] = $wgNamespaceProtection[NS_TEMPLATE] = $wgNamespaceProtection[NS_HELP] = $wgNamespaceProtection[NS_CATEGORY] = array( 'emailconfirmed' ); # Only allow sysops to edit "Policy" namespace $wgGroupPermissions['sysop']['editpolicy'] = true; $wgNamespaceProtection[NS_POLICY] = array( 'editpolicy' );
Resources
Anti-spam
- http://www.mediawiki.org/wiki/Extension:ConfirmEdit
- https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/ConfirmEdit.git;a=snapshot;h=refs/heads/master;sf=tgz
- questy is very easy to set up
- can't get asirra to work, either through confirmedit or standalone extrension
# Protect shit require_once("$IP/extensions/ConfirmEdit/ConfirmEdit.php"); require_once("$IP/extensions/ConfirmEdit/QuestyCaptcha.php"); $wgCaptchaClass = 'QuestyCaptcha'; $wgCaptchaQuestions[] = array( 'question' => '123 + 1 =', 'answer' => '124' ); $wgCaptchaQuestions[] = array( 'question' => '321 + 2 =', 'answer' => '323' ); etc. $wgGroupPermissions['*' ]['skipcaptcha'] = false; $wgGroupPermissions['user' ]['skipcaptcha'] = false; $wgGroupPermissions['autoconfirmed']['skipcaptcha'] = false; $wgGroupPermissions['bot' ]['skipcaptcha'] = true; // registered bots $wgGroupPermissions['sysop' ]['skipcaptcha'] = true; $wgGroupPermissions['emailconfirmed']['skipcaptcha'] = true; $ceAllowConfirmedEmail = true; $wgCaptchaTriggers['edit'] = false; $wgCaptchaTriggers['create'] = false; $wgCaptchaTriggers['addurl'] = true; $wgCaptchaTriggers['createaccount'] = true; $wgCaptchaTriggers['badlogin'] = true;
Tools
- http://en.wikipedia.org/wiki/Wikipedia:Tools
- http://www.mediawiki.org/wiki/Manual:Maintenance_scripts
Visualization
Templates
URL
API
Archive
SEO
php maintenance/generateSitemap.php \ --fspath sitemap \ --server http://mydomain.org \ --urlpath http://mydomain.org/sitemap