MediaWiki

Installing MediaWiki on a Nginx web server
Here is my quick guide to use MediaWiki on a Nginx server using php-fpm.

There are many ways of doing this. I like pretty url's, so this configuration will remove the  from the url. This is great, but it will not redirect links to index.php to the new none index.php links. You also need to configure MediaWiki to use short urls. Also, the below configuration dose assume your using Unix socket connections to php-fpm.

So here we go, inside your http { block, add the following.

/etc/nginx/nginx.conf: server { listen 80; server_name wiki.example.com; root /var/www/wiki.example.com; include mediawiki.conf; } /etc/nginx/mediawiki.conf: location ~ \.htaccess { deny all; }
 * 1) MediaWiki Config

location ~* /sitemaps/ { autoindex on; }

rewrite ^/index.php/(.*) /$1 permanent;
 * 1) Remove index.php from URI

location / { if (!-e $request_filename) { rewrite ^/([^?]*)(?:\?(.*))? /index.php?title=$1&$2 last; }       if ($uri ~* "\.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$") { expires max; break; } }

location ~* \.php$ { if (!-e $request_filename) { return 404; }

include /etc/nginx/fastcgi_params;

fastcgi_pass unix:/var/run/php-fpm.socket; fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME  $document_root$fastcgi_script_name; }

If you only have a single wiki on your server, there's really no reason to create a new mediawiki.conf file, but instead just add it to the server block.

Installing the Math Plugin
apt-get -y install ko.tex-extra-hlfont latex-cjk-all latex-cjk-chinese latex-cjk-chinese-arphic-bkai00mp \ latex-cjk-chinese-arphic-bsmi00lp latex-cjk-chinese-arphic-gbsn00lp latex-cjk-chinese-arphic-gkai00mp \ latex-cjk-common latex-cjk-japanese latex-cjk-japanese-wadalab latex-cjk-korean latex-cjk-thai \ latex-cjk-xcjk latex-fonts-thai-tlwg libaprutil1-dbd-sqlite3 swath texlive-xetex thailatex Next change into your MediaWiki directory and into the Math subdirectory cd extensions/Math/math And run make make Now you need to make texvccheck cd extensions/Math/texvccheck/ And run make make After the install, you need to set your conf as following: require_once( "$IP/extensions/Math/Math.php" );
 * 1) Math ###
 * 2) http://www.mediawiki.org/wiki/Extension:Math

Math Examples
Once your done, you may enter a math formula such as:

$$ \operatorname{erfc}(x) = \frac{2}{\sqrt{\pi}} \int_x^{\infty} e^{-t^2}\,dt = \frac{e^{-x^2}}{x\sqrt{\pi}}\sum_{n=0}^\infty (-1)^n \frac{(2n)!}{n!(2x)^{2n}} $$

This will produce:

$$ \operatorname{erfc}(x) = \frac{2}{\sqrt{\pi}} \int_x^{\infty} e^{-t^2}\,dt = \frac{e^{-x^2}}{x\sqrt{\pi}}\sum_{n=0}^\infty (-1)^n \frac{(2n)!}{n!(2x)^{2n}} $$

or a more simpler:

$${a}^2+{b}^2={c}^2$$

will produce:

$${a}^2+{b}^2={c}^2$$

or even pi (π): $$ \pi = \frac{C}{d}$$

will produce:

$$ \pi = \frac{C}{d}$$

How to modify the right hand menu
See: http://www.mediawiki.org/wiki/Manual:Interface/Sidebar
 * Go to MediaWiki:Sidebar (http://wiki.example.com/index.php?title=MediaWiki:Sidebar)
 * Modify the page and save

Building MediaWiki Sitemap
Build a script to be put in your server's crontab. cd /var/www/wiki.mattrude.com/ rm -f sitemap* /usr/bin/php /var/www/wiki.mattrude.com/maintenance/generateSitemap.php --server http://wiki.mattrude.com --urlpath http://wiki.mattrude.com ln sitemap-index-mattrude_com_wiki.xml sitemap.xml
 * 1) !/bin/bash

How to Patch MediaWiki
Download the patch file inside your wiki folder. wget http://download.wikimedia.org/mediawiki/1.9/mediawiki-1.9.3.patch Then to patch it run. patch -p0 -i mediawiki-1.9.3.patch

MediaWiki Tips & Tricks
To change the way the title is displayed on pages: so for example to change the name PhpLDAPadmin to phpLDAPadmin add the following.