Difference between revisions of "Wikimedia Issues"

From SlugWiki
Jump to: navigation, search
m (Odd URIs)
m (8 revisions imported)
 
(No difference)

Latest revision as of 22:28, 25 August 2015

While nice to look at and mostly easy to use, mediawiki also has it's shares of issues. Slugwiki's solution to some of these issues might be useful for others in a similar position.

Moving Servers

The debian box that formerly hosted the wiki ran mysql 4.1, whereas this OpenBSD box is running mysql 4.0. Turns out, when using mysqldump there is an option to export to the old syntax; this proved invaluable, as I was having no luck manually editing the sqldump to conform to 4.0. To do this, try

mysqldump --compatible=mysql40

After importing this data into the new mysql database, you'll need to install the wiki software; Rob opted to install the same version that was running on the old machine, 1.4.10. When performing this install, the config script will yell about a duplicate key with value 0; this is because mysqldump didn't indicate that the id columns should be auto_increment. Set this property for the table the config script complains about, and the first time you edit a page you'll have to do it again on another table. To know which (I can't remember now), modify LocalSettings.php (the wiki config file) and set $wgShowSQLErrors and then try to edit any file. Make this table auto_increment as well. If the images aren't showing up, it's necessary to make sure the new images directory has write access.

The thumbnails might be in the wrong places (mine were, for some reason) so I deleted the images/thumb directory, recreated it, chmod 777'd it, and let the wiki regenerate the thumbnails for me. To upgrade versions, download the 1.5.X release (any 1.5 should do; Rob chose the latest), and once that's complete go on to 1.6.

Thumbnails

If you have ImageMagick installed and enabled, the wiki builds image thumbnails as needed, and hashes them in the images/thumb directory. If your wiki is not doing this, make sure images/thumb is writable by the server.

Odd URIs

Mediawiki uses the machine's hostname for some URIs. Looking at the source gives this information away; two calls get the hostname via:

$hostname = $_SERVER['SERVER_NAME'];  //GlobalFunctions.php
$wgServerName = $_SERVER['SERVER_NAME'];   //DefaultSettings.php

This means that, for your wiki to work correctly, your system's hostname needs to be set appropriately! This information is read from /etc/myname on OpenBSD, and can also be set with hostname. Apache needs to be restarted before PHP notices the change.

This information seems to actually be coming from Apache's configuration file, httpd.conf. If you're interested in hosting the wiki through more than one IP address, as this wiki is, then the configuration requires you to set up multiple VirtualHosts in httpd.conf. With this done, mediawiki is going to work fine--assuming you don't want to hose the wiki at different URIs. On Slugnet, the address for this wiki is http://space-elevator.bemix/wiki/, whereas on the Internet the address is http://slugwiki.mit.edu. This confuses mediawiki's $wgScriptPath variable, since it should be set for "" for slugwiki.mit.edu, and "/wiki" for space-elevator.bemix. A simple hack takes care of these details.

Modify LocalSettings.php, replacing the $wgServerName == "" with:

if ($wgServerName == "space-elevator.bemix") {
        $wgScriptPath = "/wiki";
} else {
        $wgScriptPath = "";
}