Installing MediaWiki

From SubSurfWiki
Jump to navigation Jump to search

I have tried two methods for installing and running a MediaWiki instance.

Pretty URLs

The default URLs aren't very nice, as they contain index.php. To hide this from users, we can easily make them pretty. There are two steps: fix Apache, then fix MediaWiki.

The full instructions are here, but here's what I did...

Fix Apache

  • Add the following to httpd.conf
# This is to give nice names in the wiki
# Per this
Alias /wiki /opt/bitnami/apps/mediawiki/htdocs/index.php
RewriteEngine On
RewriteRule ^/$ /wiki [R]
  • Restart the server with sudo apachectl -k graceful

Fix MediaWiki

  • Add the following to LocalSettings.php
## This enables pretty URLs
$wgArticlePath = '/wiki/$1';  # Virtual path. This directory MUST be different from the one used in $wgScriptPath
$wgUsePathInfo = true;        # Enable use of pretty URLs

That's it!

Really pretty URLs

Seems some people don't like the extra folder /wiki/ in the path. Perhaps it can be dispensed with in many cases. Here's a discussion about it.


MediaWiki can be configured to send email messages for various functions. You will need to install some additional packages:

sudo apt-get install php-pear
sudo pear install mail
sudo pear install Net_SMTP

Also, you'll need to configure the LocalSettings.php file to use your SMTP server to send out the messages, for example:

$wgEnableEmail      = true;
$wgEnableUserEmail  = true;
$wgEmergencyContact = "";
$wgPasswordSender = "";
$wgNoReplyAddress = "";
$wgPasswordSender = "";

$wgSMTP = array(
 'host'     => "ssl://",
 'IDhost'   => "",
 'port'     => 465,
 'auth'     => true,
 'username' => "",
 'password' => "user_password"

The port probably has to be 465 for SSL. Check settings with the mail provider.

Note there is a bug in MW 1.18 requiring a small change to includes/UserMailer.php.