MediaWiki Setup Config

MediaWiki setup
Remind me what to set up :)

To enable uploads
sudo chown -R xxxx:www-data w/images

sudo chmod -R +rw www-data w/images

LocalSettings.php

$wgEnableUploads = true;

Extensions
All go into w/extensions, unpack just to w/extensions as w/extensions/XXXXX will be created.

Category tree
1.33 now builtin, now just needs enabling with LoadExtension( 'CategoryTree' );

OUT OF DATE BELOW cd ~/richud.com/w/extensions git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/CategoryTree.git

Localsettings.php

$wgUseAjax = true;

require_once("{$IP}/extensions/CategoryTree/CategoryTree.php");

Syntax code highlighting
1.33 now builtin, now just needs enabling with wfLoadExtension( 'SyntaxHighlight_GeSHi' );

OUT OF DATE BELOW

cd ~/richud.com/w/extensions git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/SyntaxHighlight_GeSHi.git

LocalSettings.php

require_once("$IP/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php");

RawFile
NO LONGER WORKS IN 1.33 (TODO: pages need fixing with this in)

cd richud.com/w/extensions

wget -N --content-disposition "http://wiki.yobi.be/index.php?title=Mediawiki_RawFile&action=raw&file=RawFile.php"

LocalSettings.php

require_once("$IP/extensions/RawFile/RawFile.php");

EmbedVideo
http://www.mediawiki.org/wiki/Extension:EmbedVideo

cd richud.com/w/extensions git clone https://gitlab.com/hydrawiki/extensions/EmbedVideo.git

LocalSettings.php

add

wfLoadExtension( 'EmbedVideo' );

ArticleComments
NOT USING

http://www.mediawiki.org/wiki/Extension:ArticleComments

cd richud.com/w/extensions

svn export http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/ArticleComments/

Killing spam
NOT USING

In this file ArticleComments/ArticleComments.php

Below this line, function defaultArticleCommentSpamCheck( $comment, $commenterName, $commenterURL, &$isSpam ) {

Add this if(ereg('yes', file_get_contents('http://www.stopforumspam.com/api?ip='.getenv(REMOTE_ADDR)))) { return $isspam = true; }

LocalSettings.php

require_once("$IP/extensions/ArticleComments/ArticleComments.php");

Widgets
http://www.mediawiki.org/wiki/Extension:Widgets

NEEDED for DISQUS

cd ~/richud.com/w/extensions git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Widgets.git cd Widgets composer update --no-dev

Make sure ~/richud.com/w/extensions/Widgets/compiled_templates is writable by www-data

LocalSettings.php add

wfLoadExtension( 'Widgets' ); $wgGroupPermissions['sysop']['editwidgets'] = true;

DISQUS Widget
http://www.mediawikiwidgets.org/DISQUS

Need to install Widgets plugins, then create two pages (although template doesn't need to be can just cut n paste the widget code (starting {{#widget:DISQUS ...) in to a page directly)

1) Create http://www.richud.com/wiki/Widget:DISQUS

Cut n paste code from http://www.mediawikiwidgets.org/w/index.php?title=Widget:DISQUS&action=edit into URL above (create page)

2) Create template http://www.richud.com/wiki/Template:DISQUS

Cut n paste into URL above (Create page), "replace id with site shortname"

{{#widget:DISQUS }}
 * id=yourid
 * uniqid={{PAGENAME}}
 * url={{fullurl:{{PAGENAME}}}}

After doing these two steps can then embedded a a Disqus page with just this template reference in the page

{{DISQUS}}

SPAM blocking
Add to LocalSettings.php to do DNS BL's

$wgEnableDnsBlacklist = true; $wgDnsBlacklistUrls = array('zen.spamhaus.org');
 * 1) $wgDnsBlacklistUrls = array( 'xbl.spamhaus.org', 'opm.tornevall.org' );

Cleaning
sudo apt-get install php5-cli cd ~/richud.com/w/maintenance/ sudo -u www-data php deleteOldRevisions.php --delete sudo -u www-data php rebuildall.php

Update Mediawiki
tar xvzf mediawiki-1.22.1.tar.gz -C ~/richud.com/w/ --strip-components=1 cd ~/richud.com/w/maintenance sudo -u www-data php update.php sudo -u www-data php sqlite.php --vacuum