ELS Howto: MediaWiki
Synopsis
This document describes how to install MediaWiki, the same software that powers Wikipedia, on your Elemental Linux Server (ELS) system.
Prerequisites
These instructions assume that you have a working PHP-enabled web server and a working email system. If you do not, see the ELS Howto: Apache and PHP and the ELS Howto: Remote Mail before beginning this document.
You may also want to install the following packages for additional functionality:
Installation
MediaWiki has been around a while and is well documented, however support of the SQLite database backend is a relatively new feature. Therefore, these instructions concentrate on the database portion of the setup.
Here are the important points to remember when installing MediaWiki with the SQLite backend.
- MediaWiki assumes that your SQLite database will reside in a directory named "data" that is at the same level as your web server's document root. So if your web server documents are in /home/httpd, MediaWiki will try to create its SQLite database in /home/data. You can work around this by creating a symbolic link for the data directory that points to your actual SQLite database directory.
- The MediaWiki installer expects you to supply a username and password to connect to your database. However, SQLite does not use this type of connection. To prevent the installer from generating errors, you will need to make up some ficticious values for these fields.
Based on the information above, here are the instructions for installing MediaWiki on an ELS system:
- Fetch the latest 1.3.x version of MediaWiki from http://www.mediawiki.org/.
- Extract the MediaWiki archive into your web server's document root directory.
- Create a symbolic link with the name of your wiki that points to the MediaWiki directory.
- Change ownership of the MediaWiki config directory to the same user that httpd runs as.
- Create a directory for the SQLite database that is outside of the web server's document root.
- Change the ownership of the database directory to the same user that httpd runs as.
- Create a symbolic link called data that points to your SQLite database directory. This symlink should reside in the parent directory of your webserver's document root.
Example
The following example shows how you would install MediaWiki if your web server document root were /home/httpd and your SQLite databases were stored in /home/SQLite.
cd ~
wget http://download.mediawiki.org/mediawiki/1.13/mediawiki-1.13.4.tar.gz
cd /home/httpd
tar -zxf ~/mediawiki-1.13.4.tar.gz
ln -s mediawiki-1.13.4 WikiName
chown -R daemon mediawiki-1.13.4/config
mkdir /home/SQLite
chown daemon /home/SQLite
ln -s /home/SQLite /home/data
Note
WikiName should be replaced with whatever you want to call your wiki, provided the resulting URL is valid.
Configuration
Configuration of MediaWiki is done through a web browser interface and is most easily performed from a client workstation with a graphical browser.
- Point your web browser to the base URL of your wiki and click "set up the wiki".
- Verify that there are no errors detected and begin filling in values on the site configuration form, customizing as needed.
- Check that SQLite is selected as the database type.
- Leave the database name set to the default value or change it to match the name of your wiki.
- None of the other database settings apply to SQLite, but the installer will not continue without a DB username and DB password.
- After entering a DB username and DB password, click on the "Install MediaWiki!" button
- Follow any remaining instructions given by the MediaWiki installer.
Example
The following example shows the Database Settings fields of the installer for a wiki located in /home/httpd/wiki and a database stored in /home/SQLite:
Database type: SQLite
Database host: Value does not matter
Database name: WikiName
DB user: Value does not matter, but must not be blank
DB password: Value does not matter, but must not be blank
DB password confirm: Value does not matter, but must not be blank
Note
After completing the installation, you should consider customizing some of the values in LocalSettings.php. Specifically, you'll want to do the following:
- Set $wgSQLiteDataDir to the location of your SQLite database. This will enable you to remove the data symlink that was created prior to running the MediaWiki installer.
- Enable ImageMagick by uncommenting the line "$wgEnableImageMagick = true;"
- Correct the value of $wgImageMagickConvertCommand to be /opt/bin/convert
- Add a variable $wgLogo that points to the location of a custom graphic to be displayed on your wiki.
Testing
Testing of the configuration is done as you follow the web-based install procedure and possible remedies to common errors are displayed in the browser. However, there are a few things that can be checked if you cannot access the MediaWiki configuration page.
- Run netstat -tl to verify that httpd is listening on port 80.
- Check that PHP is installed properly. There is a good test script at http://www.htmlite.com/php003.php
- Verify that firewall rules allow unrestricted access for on port 80 for any hosts trying to access phpBB.
- Test network connectivity to the server by pinging it from another machine.
For additional help with installation and configuration, please refer to the MediaWiki home page.