Katlas installation notes: Difference between revisions
m (Reverted edits by LapasOrsit (Talk); changed back to last version by Drorbn)  | 
				|||
| (82 intermediate revisions by 10 users not shown) | |||
| Line 1: | Line 1: | ||
On July 14, 2007 we've upgraded MediaWiki to version 1.10.1. The pre-upgrade installation notes are at [[MediaWiki 1.4 installation notes]].  | 
|||
Okay... these are our notes while trying to setup [http://katlas.math.toronto.edu/wiki/ the wiki on katlas].  | 
  |||
==  | 
  ===Fixing search===  | 
||
In file <tt>/www/html/w/skins/MonoBook.php</tt> change <tt><form ... id="searchform"></tt> to <tt><form method=post ... id="searchform"></tt>.  | 
|||
For better or worse, I decided to upgrade MySQL to version 4.0 before doing anything else. I mostly followed [http://dev.mysql.com/doc/mysql/en/linux-rpm.html these instructions].  | 
  |||
===Rendering PNG===  | 
|||
''Warning: do not install MySQL 4.1. It is incompatible with mediawiki. Install version 4.0.''  | 
  |||
Follow the instructions at http://mywiki.ncsa.uiuc.edu/wiki/MediaWiki_Servers#Problems_Rendering_PNG_Images:  | 
|||
*Add to LocalSettings.php  | 
|||
For this I need three RPMs which are all available with only a little digging at [http://www.mysql.com/ mysql.com]  | 
  |||
* MySQL-shared-compat-4.0.25-0.i386.rpm   | 
  |||
* MySQL-server-4.0.25-0.i386.rpm  | 
  |||
* MySQL-client-4.0.25-0.i386.rpm  | 
  |||
The first of these is required so we don't break dependencies while upgrading. Install it first, with  | 
  |||
:rpm -iv MySQL-shared-compat-4.0.25-0.i386.rpm  | 
  |||
Then upgrade the other two packages  | 
  |||
:rpm -U MySQL-server-4.0.25-0.i386.rpm  | 
  |||
:rpm -U MySQL-client-4.0.25-0.i386.rpm  | 
  |||
Note the warning the server install gives --   | 
  |||
<pre>  | 
  <pre>  | 
||
$wgMimeDetectorCommand = "file -bi";   | 
|||
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !  | 
  |||
To do so, start the server, then issue the following commands:  | 
  |||
/usr/bin/mysqladmin -u root password 'new-password'  | 
  |||
/usr/bin/mysqladmin -u root -h katlas.math.toronto.edu password 'new-password'  | 
  |||
See the manual for more instructions.  | 
  |||
</pre>  | 
  </pre>  | 
||
*then rebuild images  | 
|||
(note however that you need to upgrade the client package before mysqladmin is available to do this!)  | 
  |||
I also deleted the local anonymous account, and put a password on the remote anonymous account. (Ask [[User:Scott]] for these passwords.)  | 
  |||
==Apache==  | 
  |||
I had to fix the server name, from katlas to katlas.math.toronto.edu in /etc/httpd/conf/httpd.conf  | 
  |||
I added  | 
  |||
 AllowOverride FileInfo  | 
  |||
 AllowOverride AuthConfig  | 
  |||
in the httpd.conf file, in the section for /var/www/html, so I could use .htaccess files to rewrite the wiki URLs nicely, and to disallow access to phpMyAdmin.  | 
  |||
I added a [http://meta.wikimedia.org/wiki/Robots.txt robots.txt] file, to protect the wiki internals from spiders. --[[User:Scott|Scott]] 12:44, 19 Aug 2005 (EDT)  | 
  |||
I moved the document root from /var/www/html to /www/html. (Actually, I moved everything in /var/www to /www) This required the following steps  | 
  |||
# in /var/www, as root <pre>cp -R --preserve * /www</pre>  | 
  |||
# in httpd.conf, replacing /var/www everywhere with /www  | 
  |||
# in LocalSettings.php replacing /var/www with /www in the $IP line  | 
  |||
# test everything seems to work!  | 
  |||
# in /var, as root, <pre>rm -Rf www</pre>  | 
  |||
--[[User:Scott|Scott]] 12:44, 19 Aug 2005 (EDT)  | 
  |||
This messed up webalizer, however, so I modified the appropriate line in /etc/webalizer.conf. I also added a section in http.conf to make /usage world-readable. --[[User:Scott|Scott]] 13:03, 19 Aug 2005 (EDT)  | 
  |||
Restarting apache is best achieved by (as root)  | 
  |||
<pre>/usr/sbin/apachectl graceful</pre>  | 
  |||
or  | 
  |||
<pre>/etc/rc.d/init.d/httpd restart</pre>--[[User:Scott|Scott]] 13:17, 19 Aug 2005 (EDT)  | 
  |||
Error logs can be found at /var/log/httpd --[[User:Scott|Scott]] 10:33, 26 Aug 2005 (EDT)  | 
  |||
We had a nasty (to diagnose!) problem with uploading large files. We had to edit /etc/httpd/conf.d/php.conf, modifying the LimitRequestBody line. --[[User:Scott|Scott]] 11:08, 23 Aug 2005 (EDT)  | 
  |||
===creating new accounts===  | 
  |||
As root, do something like  | 
  |||
<pre>  | 
  <pre>  | 
||
# cd /www/html/w/maintenance  | 
|||
$ htpasswd -m /www/.htpasswd sally  | 
  |||
# php rebuildImages.php   | 
|||
New password: *******  | 
  |||
Processing image...  | 
|||
Re-type new password: *******  | 
  |||
Finished image... 3 of 4 rows updated  | 
|||
Adding password for user sally  | 
  |||
Processing oldimage...  | 
|||
Finished oldimage... 2 of 2 rows updated  | 
|||
#  | 
|||
</pre>  | 
  </pre>  | 
||
===Creating nice thumbnails with ImageMagick===  | 
|||
==phpMyAdmin==  | 
  |||
Unfortunately, they've broken things in mediawiki 1.10, and creating thumbnails of transparent gifs is horrible. If you make the following changes to /includes/media/Bitmap.php, things should behave just like in mediawiki 1.4 (i.e. perfectly, for our purposes).  | 
|||
Just unzip'd it into phpMyAdmin, editted the config.inc.php, created a .htpassword file and added a <nowiki><Directory></nowiki> entry to httpd.conf --[[User:Scott|Scott]] 10:34, 26 Aug 2005 (EDT)  | 
  |||
==MediaWiki==  | 
  |||
I added the namespace "Data", and later "Article", as per [http://meta.wikimedia.org/wiki/Help:Custom_namespaces these instructions], adding  | 
  |||
<pre>  | 
  <pre>  | 
||
                        // replacing this all with something much simpler from around mediawiki 1.4  | 
|||
$wgExtraNamespaces =  | 
  |||
                        # $cmd  =  wfEscapeShellArg($wgImageMagickConvertCommand) .  | 
|||
       array(100 => "Data",  | 
  |||
                        #       " {$quality} -background white -size {$physicalWidth} ".  | 
|||
             101 => "Data_talk",  | 
  |||
                        #       wfEscapeShellArg($srcPath) .  | 
|||
                        #       // Coalesce is needed to scale animated GIFs properly (bug 1017).  | 
|||
             103 => "Article_talk");  | 
  |||
                        #       ' -coalesce ' .  | 
|||
# Enable subpages in the knot data namespace  | 
  |||
                        #       // For the -resize option a "!" is needed to force exact size,  | 
|||
$wgNamespacesWithSubpages[100] = 1;  | 
  |||
                        #       // or ImageMagick may decide your ratio is wrong and slice off  | 
|||
$wgNamespacesWithSubpages[101] = 1;  | 
  |||
                        #       // a pixel.  | 
|||
$wgNamespacesWithSubpages[102] = 1;  | 
  |||
                        #       " -thumbnail " . wfEscapeShellArg( "{$physicalWidth}x{$physicalHeight}!" ) .  | 
|||
$wgNamespacesWithSubpages[103] = 1;  | 
  |||
                        #       " -depth 8 $sharpen " .  | 
|||
                        #       wfEscapeShellArg($dstPath) . " 2>&1";  | 
|||
                        // here's what we used to do, back in mediawiki 1.4, and it works great.  | 
|||
                        $cmd  =  wfEscapeShellArg($wgImageMagickConvertCommand) .  | 
|||
                                " {$quality} -background white -geometry {$physicalWidth} ".  | 
|||
                                wfEscapeShellArg($srcPath) . " " .  | 
|||
                                wfEscapeShellArg($dstPath) . " 2>&1";  | 
|||
</pre>  | 
  </pre>  | 
||
to LocalSettings.php. Do not use spaces in the namespace names, only underscores.  | 
  |||
===Enable <nowiki><math></math></nowiki> processing===  | 
  |||
First, I made the /images directory writable.  | 
  |||
Next, I installed ocaml (download the sources, ./configure, make world, make bootstrap, make opt, make install). What a pain! After that, go to the math directory under the wiki installation, and run make.  | 
  |||
Finally, edit LocalSettings.php to enable TeX.  | 
  |||
Later, we started modifying texvc, to allow more symbols from amssymb, and to allow use of Dror's [http://www.math.toronto.edu/~drorbn/projects/dbnsymb/dbnsymbman.html dbnsymb]. This required modifications to [[Texutil.ml]], and recompiling texvc (just run make). --[[User:Scott|Scott]] 15:10, 29 Aug 2005 (EDT)  | 
  |||
====Installing the Font dbnsymb====  | 
  |||
# Download the files dbnsymb.mf and dbnsymb.sty from [http://www.math.toronto.edu/~drorbn/projects/dbnsymb/dbnsymbman.html].  | 
  |||
# Put dbnsymb.mf at "/usr/share/texmf/fonts/source/public".  | 
  |||
# Put dbnsymb.sty at "/usr/share/texmf/tex/latex/misc".  | 
  |||
# Run the command "texhhash".  | 
  |||
===Allowing .zip and .gif uploads===  | 
  |||
In LocalSettings.php I added the line  | 
  |||
<pre>  | 
  |||
$wgFileExtensions = array( 'png','gif','jpg','jpeg','ogg','mp3','pdf','zip');  | 
  |||
</pre>  | 
  |||
===Marking users as bots===  | 
  |||
See [http://meta.wikimedia.org/wiki/Setting_user_rights_in_MediaWiki]. Note that all our tables have the prefix mw_. As far as I can tell, you have to guess the user number (or you can log in as that user, and go to Preferences).  | 
  |||
===Modifying the navigation box===  | 
  ===Modifying the navigation box===  | 
||
Edit [[MediaWiki:Sidebar]].  | 
|||
Follow the instructions at [http://meta.wikimedia.org/wiki/MediaWiki_FAQ#How_to_customize_your_own_navigation_bar]  | 
  |||
# Make changes to LocalSettings.php  | 
  |||
# edit the pages Mediawiki:todo, Mediawiki:todo-url, Mediawiki:rolfsen, Mediawiki:rolfsen-url, etc. (these pages are protected.)  | 
  |||
Note that this will change in mediawiki 1.5, and become a lot easier.  | 
  |||
===Add "tour" sidebar box===  | 
  ===Add "tour" sidebar box===  | 
||
In skins/MonoBook.php, right above the   | 
  In skins/MonoBook.php, right above the lines  | 
||
 <?php  | 
|||
 <?php if( $this->data['language_urls'] )  | 
  |||
                 if( $this->data['language_urls'] ) { ?>  | 
|||
add lines as follows:<pre><nowiki>  | 
  add lines as follows:<pre><nowiki>  | 
||
        <div class="portlet" id="p-tour">  | 
          <div class="portlet" id="p-tour">  | 
||
| Line 143: | Line 70: | ||
        </div>  | 
          </div>  | 
||
</nowiki></pre>  | 
  </nowiki></pre>  | 
||
(this will surely change as we understand MediaWiki better)  | 
  |||
===  | 
  ==="Redraw Page" tab===  | 
||
Grab [[Image:The_Knot_Atlas.png|36px]], resize it to 145x145, save it as /www/html/w/skins/common/images/katlas.png, and put the line  | 
  |||
 $wgLogo             = "$wgStylePath/common/images/katlas.png";  | 
  |||
in LocalSettings.php. Also, grab [[Image:favicon.png|16px]], convert it to Windows .ico format and save it as favicon.ico at /www/html (not /www/html/w !).  | 
  |||
Add to [[MediaWiki:Monobook.js]], following [http://en.wikipedia.org/wiki/Wikipedia:WikiProject_User_scripts/Scripts/Add_purge_to_tabs Wikipedia:WikiProject User scripts/Scripts/Add purge to tabs]:  | 
|||
===Hacking mediawiki===  | 
  |||
I modified [[ImagePage.php]] so redirects on image pages don't produce a spurious copy of the image. There's [http://bugzilla.wikimedia.org/show_bug.cgi?id=539 a bug] on bugzilla, where a different fix is being proposed. There's [http://meta.wikimedia.org/wiki/User:Sysy/Joshua_Oreman%27s_icon_extension another (not so good?) solution] as an extension.  | 
  |||
 addOnloadHook(function () {  | 
|||
Later, I modified [[Math.php]], so if a math .png file is missing, but isn't immediately needed, it isn't regenerated. This let's us delete .png files from /w/images/math. To avoid creating too many such .png images in the first place, any robots uploading math formulas should have 'Leave TeX' set in their math preferences. --[[User:69.110.11.59|69.110.11.59]] 04:59, 21 Sep 2005 (EDT)  | 
  |||
     var hist; var url;  | 
|||
     if (!(hist = document.getElementById('ca-history') )) return;  | 
|||
     if (!(url = hist.getElementsByTagName('a')[0] )) return;  | 
|||
     if (!(url = url.href )) return;  | 
|||
     addPortletLink('p-cactions', url.replace(/([?&]action=)history([&#]|$)/, '$1purge$2'),  | 
|||
                    'redraw page', 'ca-purge', 'Purge server cache for this page', '0');  | 
|||
 });  | 
|||
===  | 
  ===Spam filtering===  | 
||
Follow the directions at http://www.mediawiki.org/wiki/Extension:SpamBlacklist  | 
|||
In file <tt>/www/html/w/skins/MonoBook.php</tt> within <tt><form name="searchform" ... ></tt> add <tt>method="post"</tt>.  | 
  |||
===  | 
  ===Tweaking the job queue===  | 
||
Running jobs seems to slow everything down horribly. It's '''essential''' that you add  | 
|||
Allow logins on several wikis on the same server: Add the following line to LocalSettings.php after <code>$wgSiteName = ...</code>:  | 
  |||
<pre>  | 
|||
 ini_set("session.name", "KnotAtlasSession" );  | 
  |||
$wgJobRunRate = 0.01;  | 
|||
</pre>  | 
|||
to <code>LocalSettings.php</code>. It may prove necessary to add a cron job running <code>/w/maintenance/runJobs.php</code>, if the length of the job queue (see [[Special:Statistics]]) gets out of hand. This should only happen after edits to widely used templates.  | 
|||
In an attempt to stop the job queue from processing latex, Scott added a line to <code>includes/JobQueue.php</code>.  | 
|||
===Spam blacklists===  | 
  |||
<pre>  | 
|||
After surviving several annoying spam attacks on my private wiki, I learnt how to deal with it, and I'm applying what I've learnt here. See /w/extensions/SpamBlacklist for the spam blacklist extension, and LocalSettings.php for the changes required there. Things should just work. Even better, if you're a sysop, you can just edit the page [[Local spam blacklist]] to add regular expressions.  I've downloaded the latest copy of the [http://meta.wikimedia.org/wiki/Spam_blacklist spam blacklist from meta], but we should update it more often. Updating it is simply a matter of running /www/html/w/extensions/SpamBlacklist/load_lists --[[User:Scott|Scott]] 13:20, 29 Sep 2005 (EDT)  | 
  |||
$options = new ParserOptions;  | 
|||
// turning off math rendering while processing jobs, because it's a terrible idea.  | 
|||
$options->setUseTeX( false );  | 
|||
</pre>  | 
|||
===Installing ParserFunctions===  | 
|||
Can we create a cron job for /www/html/w/extensions/SpamBlacklist/load_lists, or add it to our backup script? --[[User:Scott|Scott]] 13:20, 29 Sep 2005 (EDT)  | 
  |||
In order to use template-like parser functions, such as <code>{{#ifexist:<pagename>|<true>|<false>}}</code>, we need to enable the ParserFunctions extension, following the instructions at http://meta.wikimedia.org/wiki/ParserFunctions.  | 
|||
Download the files  | 
|||
==Server security==  | 
  |||
* [http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/ParserFunctions/Expr.php Expr.php]  | 
|||
Everyday we have scripts come through trying to login through sshd, with various user/pass combinations. If we need to a solution we could either  | 
  |||
* [http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/ParserFunctions/ParserFunctions.php ParserFunctions.php]  | 
|||
# move sshd to listen on another port  | 
  |||
* [http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/ParserFunctions/ParserFunctions.i18n.php ParserFunctions.i18n.php]  | 
|||
# install on the the scripts described at http://www.linux.com/article.pl?sid=05/09/15/1655234  | 
  |||
and then add a line to LocalSettings.php:  | 
|||
<pre>  | 
|||
require_once( "$IP/extensions/ParserFunctions/ParserFunctions.php" );  | 
|||
</pre>  | 
|||
===Installing a PHP cache===  | 
|||
Look at http://meta.wikimedia.org/wiki/PHP_caching_and_optimization.  | 
|||
# Install PEAR, by saving http://go-pear.org/ as <code>/home/wiki/pear/go-pear.php</code>, then running <code>php go-pear.php</code> and following the prompts  | 
|||
==Subversion==  | 
  |||
# Install APC, by running <code>/home/wiki/pear/bin/pecl install apc</code>  | 
|||
We have a working subversion server going now. (I had to find the RHEL3 rpm, but it was easy after that!)  | 
  |||
# Add <code>extension=apc.so</code> to <code>/etc/php.ini</code>  | 
|||
You can see APC's statistics at http://katlas.org/apc.php  | 
|||
We have several separate repositories, and it's easy (for root) to create more. Go to one of   | 
  |||
*http://katlas.math.toronto.edu/svn/KnotAtlas  | 
  |||
*http://katlas.math.toronto.edu/svn/KnotTheory  | 
  |||
*http://katlas.math.toronto.edu/svn/WikiLink  | 
  |||
*http://katlas.math.toronto.edu/svn/QuantumGroups  | 
  |||
*http://katlas.math.toronto.edu/svn/Tungsten  | 
  |||
to get started.  | 
  |||
Add  | 
|||
To create a new repository, type something like  | 
  |||
<pre>  | 
  <pre>  | 
||
# See http://www.mediawiki.org/wiki/Manual:%24wgMainCacheType  | 
|||
svnadmin create RepositoryName /home/svn  | 
  |||
$wgMainCacheType = CACHE_ACCEL;  | 
|||
</pre>  | 
  </pre>  | 
||
to <code>LocalSettings.php</code>.  | 
|||
then change the ownership and permissions to match the other repositories. (The easiest way to do this is to login as svn, before using svnadmin, then <code>chmod -R g+w /home/svn/RepositoryName</code> to allow commits via the web.)  | 
  |||
===Installing memcached===  | 
|||
There's read-only public access; to commit changes you'll need to [[#creating new accounts|create an account]]. For windows, download [http://tortoisesvn.tigris.org/ TortoiseSVN], for eclipse use subclipse.  | 
  |||
In my continuing quest for faster page loads, I'm trying memcached. Follow the nice instructions at http://blog.ajohnstone.com/archives/installing-memcached/.  | 
|||
Although it's not installed, it's not running, or being used. See http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/docs/memcached.txt?view=markup for instructions for actually running it. You'll probably need to uncomment some lines in LocalSettings.php too.  | 
|||
Mathematica notebooks are slightly hard to version control. There are several solutions people have come up with.  | 
  |||
*http://www.itwm.fhg.de/as/asemployees/wichmann/nbcache.html A perl script for stripping out the cache data.  | 
  |||
*Using the ShowShortBoxForm option in Mathematica [http://forums.wolfram.com/mathgroup/archive/2005/Mar/msg00175.html], which apparently makes notebooks less prone to arbitrary changes independent of real content changes.  | 
  |||
===Updating CSS and JS===  | 
|||
==mailman==  | 
  |||
* Write [http://en.wikipedia.org/wiki/MediaWiki:Common.css MediaWiki:Common.css] on top of the local [[MediaWiki:Common.css]].  | 
|||
I didn't take notes as I installed this. Some things to remember:  | 
  |||
* Write [http://en.wikipedia.org/wiki/MediaWiki:Monobook.css MediaWiki:Monobook.css] on top of the local [[MediaWiki:Monobook.css]].  | 
|||
*You need to open up some ports for Sendmail -- see [[#iptables]] below.  | 
  |||
* Write [http://en.wikipedia.org/wiki/MediaWiki:Common.js MediaWiki:Common.js] on top of the local [[MediaWiki:Common.js]] being super-careful not to step on any of our extensions.  | 
|||
*You need to change /etc/aliases  | 
  |||
===Increasing PHP's memory_limit===  | 
|||
==bugzilla==  | 
  |||
In LocalSettings.php, change  | 
|||
I didn't take notes as I installed this. --[[User:Scott|Scott]] 15:35, 5 Dec 2005 (EST)  | 
  |||
 ini_set( 'memory_limit', '20M' );  | 
|||
to  | 
|||
 ini_set( 'memory_limit', '40M' );  | 
|||
===Fixing "Random Page"===  | 
|||
==cruisecontrol==  | 
  |||
I didn't take notes as I installed this. --[[User:Scott|Scott]] 15:35, 5 Dec 2005 (EST)  | 
  |||
==iptables==  | 
  |||
Arno's iptables is the way to go. Just edit  | 
  |||
<pre>  | 
  |||
/etc/iptables-firewall.conf  | 
  |||
</pre>  | 
  |||
To restart, use  | 
  |||
<pre>  | 
  |||
/etc/init.d/rc.iptables restart  | 
  |||
</pre>  | 
  |||
The standard MediaWiki [[Special:Random|random page]] algorithm is strange, and anyway unsuitable for our purposes. See [[Fixing "Random Page"]] for the details and for our fix.  | 
|||
==Things we should include in the backup==  | 
  |||
*/etc/httpd/conf/httpd.conf  | 
  |||
*/etc/aliases  | 
  |||
*some part of mailman?  | 
  |||
**just the /usr/local/mailman/archives directory?  | 
  |||
**maybe /usr/local/mailman/lists as well?  | 
  |||
Latest revision as of 17:10, 8 January 2009
On July 14, 2007 we've upgraded MediaWiki to version 1.10.1. The pre-upgrade installation notes are at MediaWiki 1.4 installation notes.
Fixing search
In file /www/html/w/skins/MonoBook.php change <form ... id="searchform"> to <form method=post ... id="searchform">.
Rendering PNG
Follow the instructions at http://mywiki.ncsa.uiuc.edu/wiki/MediaWiki_Servers#Problems_Rendering_PNG_Images:
- Add to LocalSettings.php
 
$wgMimeDetectorCommand = "file -bi";
- then rebuild images
 
# cd /www/html/w/maintenance # php rebuildImages.php Processing image... Finished image... 3 of 4 rows updated Processing oldimage... Finished oldimage... 2 of 2 rows updated #
Creating nice thumbnails with ImageMagick
Unfortunately, they've broken things in mediawiki 1.10, and creating thumbnails of transparent gifs is horrible. If you make the following changes to /includes/media/Bitmap.php, things should behave just like in mediawiki 1.4 (i.e. perfectly, for our purposes).
                        // replacing this all with something much simpler from around mediawiki 1.4
                        # $cmd  =  wfEscapeShellArg($wgImageMagickConvertCommand) .
                        #       " {$quality} -background white -size {$physicalWidth} ".
                        #       wfEscapeShellArg($srcPath) .
                        #       // Coalesce is needed to scale animated GIFs properly (bug 1017).
                        #       ' -coalesce ' .
                        #       // For the -resize option a "!" is needed to force exact size,
                        #       // or ImageMagick may decide your ratio is wrong and slice off
                        #       // a pixel.
                        #       " -thumbnail " . wfEscapeShellArg( "{$physicalWidth}x{$physicalHeight}!" ) .
                        #       " -depth 8 $sharpen " .
                        #       wfEscapeShellArg($dstPath) . " 2>&1";
                        // here's what we used to do, back in mediawiki 1.4, and it works great.
                        $cmd  =  wfEscapeShellArg($wgImageMagickConvertCommand) .
                                " {$quality} -background white -geometry {$physicalWidth} ".
                                wfEscapeShellArg($srcPath) . " " .
                                wfEscapeShellArg($dstPath) . " 2>&1";
Edit MediaWiki:Sidebar.
Add "tour" sidebar box
In skins/MonoBook.php, right above the lines
<?php
                if( $this->data['language_urls'] ) { ?>
add lines as follows:
        <div class="portlet" id="p-tour">
          <h5><a href="/wiki/Tour_of_the_Knot_Atlas">tour</a></h5>
          <div class="pBody">
            <ul>
            <li><a href="/wiki/5_2">5 2</a> (edit me!)
            <li><a href="/wiki/5_2_Quantum_Invariants">5 2 Quantum Invariants</a>
            <li><a href="/wiki/L10n85">L10n85</a>
            <li><a href="/wiki/The_Multivariable_Alexander_Polynomial">Multivariable Alexander</a>
            <li><a href="/wiki/Knot_Atlas:About">About</a>
            <li><a href="/wiki/Data:5_2/Bridge_Index">Data:5_2/Bridge_Index</a>
            <li><a href="/wiki/The_Mathematica_Package_KnotTheory%60">Knot Theory`</a>
            <li><a href="/wiki/How_to_Edit_this_Manual...">How to Edit Manual...</a>
            <li><a href="/wiki/Modifying_Knot_Pages">Modifying Knot Pages</a>
            <li><a href="/wiki/Special:Recentchanges">Recent changes</a>
            <li><a href="/wiki/To_Do">To Do</a> (history!)
            </ul>
          </div>
        </div>
"Redraw Page" tab
Add to MediaWiki:Monobook.js, following Wikipedia:WikiProject User scripts/Scripts/Add purge to tabs:
addOnloadHook(function () {
    var hist; var url;
    if (!(hist = document.getElementById('ca-history') )) return;
    if (!(url = hist.getElementsByTagName('a')[0] )) return;
    if (!(url = url.href )) return;
    addPortletLink('p-cactions', url.replace(/([?&]action=)history([&#]|$)/, '$1purge$2'),
                   'redraw page', 'ca-purge', 'Purge server cache for this page', '0');
});
Spam filtering
Follow the directions at http://www.mediawiki.org/wiki/Extension:SpamBlacklist
Tweaking the job queue
Running jobs seems to slow everything down horribly. It's essential that you add
$wgJobRunRate = 0.01;
to LocalSettings.php. It may prove necessary to add a cron job running /w/maintenance/runJobs.php, if the length of the job queue (see Special:Statistics) gets out of hand. This should only happen after edits to widely used templates.
In an attempt to stop the job queue from processing latex, Scott added a line to includes/JobQueue.php.
$options = new ParserOptions; // turning off math rendering while processing jobs, because it's a terrible idea. $options->setUseTeX( false );
Installing ParserFunctions
In order to use template-like parser functions, such as <false>, we need to enable the ParserFunctions extension, following the instructions at http://meta.wikimedia.org/wiki/ParserFunctions.
Download the files
and then add a line to LocalSettings.php:
require_once( "$IP/extensions/ParserFunctions/ParserFunctions.php" );
Installing a PHP cache
Look at http://meta.wikimedia.org/wiki/PHP_caching_and_optimization.
- Install PEAR, by saving http://go-pear.org/ as 
/home/wiki/pear/go-pear.php, then runningphp go-pear.phpand following the prompts - Install APC, by running 
/home/wiki/pear/bin/pecl install apc - Add 
extension=apc.soto/etc/php.ini 
You can see APC's statistics at http://katlas.org/apc.php
Add
# See http://www.mediawiki.org/wiki/Manual:%24wgMainCacheType $wgMainCacheType = CACHE_ACCEL;
to LocalSettings.php.
Installing memcached
In my continuing quest for faster page loads, I'm trying memcached. Follow the nice instructions at http://blog.ajohnstone.com/archives/installing-memcached/.
Although it's not installed, it's not running, or being used. See http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/docs/memcached.txt?view=markup for instructions for actually running it. You'll probably need to uncomment some lines in LocalSettings.php too.
Updating CSS and JS
- Write MediaWiki:Common.css on top of the local MediaWiki:Common.css.
 - Write MediaWiki:Monobook.css on top of the local MediaWiki:Monobook.css.
 - Write MediaWiki:Common.js on top of the local MediaWiki:Common.js being super-careful not to step on any of our extensions.
 
Increasing PHP's memory_limit
In LocalSettings.php, change
ini_set( 'memory_limit', '20M' );
to
ini_set( 'memory_limit', '40M' );
Fixing "Random Page"
The standard MediaWiki random page algorithm is strange, and anyway unsuitable for our purposes. See Fixing "Random Page" for the details and for our fix.