Wiki

From CafeWiki

Jump to: navigation, search

Issues to consider:

  • security of the wiki
    • what is info that shouldn't be public?
    • how can you secure portions of the wiki?
    • what about putting the wiki inside the VPN?
  • configuration of the wiki
    • need to learn how to rename pages
    • need to learn how to modify the left-hand nav
    • need to learn how to get a good sitemap
  • other stuff


Contents

Installing Mediawiki

Sean will fill this in soon...


Updating, Upgrading or Moving Mediawiki

Sean will fill this in soon...

... but in the mean time, when Sean relocated the wiki from edgar to osprey the move went OK except that it was not possible to edit any wiki pages. The following error was displayed when an edit was attempted:

Database error
A database query syntax error has occurred. This may indicate a bug in the
software. The last attempted database query was:
    (SQL query hidden)
from within function "Database::select". MySQL returned error "1146: Table
'wikidb.mw_page_props' doesn't exist (localhost)"

The problem here is that the old database was not updated to match the new mediawiki software version (I assume that Sean had installed the current version of mediawiki with an apt-get install mediawiki and that the old wiki had an older version of mediawiki). Anyway, the problem is that the database had not been updated. Here is how you update the database (as described in Debian bug report 472831): As a precaution against screw-ups, dump your database to a text file.

mysqldump --add-drop-table -u <user> -p <my-database> > /path/to/file.sql

Get an AdminSettings.php file, by default there isn't one in the mediawiki directory, so copy the sample from the doc directory:

cp /usr/share/doc/mediawiki/examples/AdminSettings.sample /etc/mediawiki/Adminsettings.php

Edit the AdminSettings.php to provide the admin username and password on these lines:

$wgDBadminuser      = 'wikiadmin';
$wgDBadminpassword  = 'adminpass';

I wasn't sure what (if any) mediawiki user had been set up, so I just used the mysql root account info. Run the update command:

php /var/lib/mediawiki/maintenance/update.php

This depends upon having a proper php5 binary, as provided in php5-cli, not an issue given that the server is a LAMP machine. Finish up by deleting the AdminSettings.php file (for the sake of security):

rm /etc/mediawiki/AdminSettings.php

The wiki will be editable after this.


Allowing Uploads

Image uploads are not enabled by default in mediawiki. To allow uploads the following changes need to be made:

  • figure out where the installation went (in this case /var/lib/mediawiki)
  • allow read and execute access to all for the /var/lib/mediawiki/images directory
   chmod 755 /var/lib/mediawiki/images
  • edit (using nano or other editor) the LocalSettings.php file (found hiding in /etc/mediawiki ) to allow uploads
   $wgEnableUploads = true;
  • ensure that php is set to allow uploads in the php.ini file (in /etc/php5/apache2/php.ini)
   file_uploads = On

That should do the trick. Note that these locations are for ubuntu when mediawiki is installed using

   apt-get install mediawiki

More general help is available here:

   mediawiki Manual:Configuring file uploads

Setting up the Logo

This was fairly easy once I stopped breaking the LocalSettings.php file.

First, acquire an image to use as a logo and upload it to the wiki.

Image:wikiagrippaLogo.png

I chose to place the image in my own page User:Dave although, as it turns out, the logo image could have been an orphan or just referenced from here and that would work just as well. I protected the image as the admin user to prevent it from being modified by anyone but the sysop.

In the LocalSettings.php file, add the line:

   $wgLogo = 'http://www.cagrippa.com/mediawiki/images/0/0a/WikiagrippaLogo.png';

Refresh the wiki and the logo should magically appear! See Change the Wiki Logo for more info.

Limiting Vandalism

There are three things that I've done to try to reduce or limit the number of times that the wiki side needs to be repaired from vandalism.

Patrol the site

Keep an eye on the recent changes and revert vandalism as it occurs - this can be onerous, even on a small site like this as occasionally vandalism will occur repeatedly on one page and it can be difficult to revert. Simple vandalism, where garbage is simply added to a page is easiest to remove. It can be more challenging when (desired) content has been removed. Basic steps are:

  • Review the Recent Changes frequently.
  • Revert vandalism as it is noticed (View the page history and use Undo, Rollback or manually remove vandalism). I usually log in as Admin for this
  • Block the offending IP forever - this isn't of much practical use, but it makes you feel a little better :-)

Restrict Access to the Site

Limit casual access to the entire site by using apache authentication as described here. This is a little draconian in that it attempts to prevent anyone that does not know the userid/pw combination to even get to the site. Oddly, it isn't perfect and somehow vandalism started to recur about 2 months after locking down the site this way.

Disable Anonymous Editing

This maybe should have been the second step, prior to locking down site access, but I didn't think it would come to this! For this, the LocalSettings.php file is edited to disable anonymous editing as described in this section of the MediaWiki Manual. Here is what I added to the LocalSettings.php file:

## Protect against ongoing vandalism by anonymous users
## Restrict page editing to valid users only
$wgGroupPermissions['*']['edit'] = false;
## RDB - 3 Dec 2009