Manual:Installing MediaWiki on Ubuntu 10.04
| This MediaWiki page is inactive and kept for historical interest. It may document extensions or features that are obsolete and/or no longer supported. Do not rely on the information here being up-to-date. |
| This page describes the installation of an obsolete version of MediaWiki which does not receive security patches. Distribution packages are usually outdated, also they like to move around files, change the files, and do other batshit insane things. As such we cannot recommend you use them to install MediaWiki and instead install from a tarball. See tarball related information at Manual:Running MediaWiki on Ubuntu. |
This page describes how to get MediaWiki up and running on Ubuntu Desktop Edition, versions 10.04 (Lucid) and 10.10 (Maverick), using packages provided by Ubuntu.
As of November 2010, the latest version of MediaWiki in the Ubuntu repository is 1.15.5.
Contents |
Install packages [edit]
GUI
- Menu: Applications → Ubuntu Software Center
- Search for Mediawiki in the top right search box
- Select the item "mediawiki" - website engine for collaborative work
- Click Install and enter your password if required
- Wait for packages to install. You can view the status by clicking on the In Progress sidebar item
- Choose and enter the root password for MySQL (the database), if prompted
Command line
sudo apt-get install apache2 mysql-server php5 php5-mysql mediawiki
(mysql installation will ask you to create a mysql root-user password)
- An alternative is
sudo apt-get install tasksel sudo tasksel install lamp-server
If you want other extensions, like image thumbnails or APC caching, it's good to do them now before setting up Mediawiki:
sudo apt-get install php-apc imagemagick
Set URL alias of MediaWiki and server name for Apache [edit]
This section assumes you want your wiki's URL to be http://localhost/mediawiki. If this is not what you want, change "localhost" to your preferred server name and "mediawiki" to your preferred URL alias in the following instructions.
First we have to set the server name for your new Apache server.
- Run in Terminal:
-
sudo gedit /etc/apache2/httpd.conf
-
- This file is empty by default. Add the following line:
-
ServerName localhost
-
- Save and close file.
(more here)
Next you have to set the URL alias of the MediaWiki installation.
- Menu: Applications → Accessories → Terminal
- Run the following command to open Apache configuration file:
-
sudo gedit /etc/mediawiki/apache.conf
-
- Remove the '#' on the third line so that line reads:
-
Alias /mediawiki /var/lib/mediawiki
-
(You can replace /mediawiki with any alias you want, such as /mywiki)
Restart Apache service [edit]
Apache has to be restarted to read the changed configuration files.
Run in Terminal:
sudo /etc/init.d/apache2 restart
Or from Gnome Desktop GUI:
- Menu: System → Administration → Services
- Uncheck and re-check the checkbox next to Web server (Apache2)
Configure your wiki [edit]
- Open web browser and navigate to: http://localhost/mediawiki (if you changed the server name or URL alias in previous section, change the URL accordingly)
- Click "set up the wiki" link.
- For "Wiki name", you can choose any name (but not "MediaWiki") unless this installation is for a pre-existing MediaWiki instance, in which case use the same 'Wiki name' as the previous installation.
- "Contact e-mail", "Language", "Copyright/license", "Admin username" can be left unchanged.
- You will have to enter a password for the wiki administrator (default username 'WikiSysop'), and enter it again to confirm.
- "Shared memory cacheing", "Memcached servers": leave unchanged.
- "E-mail features (global)" - set to "Disabled" unless you plan to use MediaWiki's e-mail features.
- "User-to-user e-mail", "E-mail notification about changes", "E-mail address authentication", "Database type", "Database host": leave unchanged.
- "Database name", "DB username": leave unchanged to allow MediaWiki to create a user for accessing the wiki database, unless you have already used MySQL Administrator to create a database and user for MediaWiki.
- "DB password", "DB password confirm": Enter password for the wiki database user twice. Warning: This password will be stored in plain text in LocalSettings.php!
- To let MediaWiki create the wiki database and database user, click the "Use superuser account" checkbox and enter the MySQL superuser name and password.
- Click 'Install MediaWiki!' button.
Move LocalSettings.php [edit]
Run in Terminal:
sudo mv /var/lib/mediawiki/config/LocalSettings.php /etc/mediawiki/
Short URL [edit]
You can make 'shorter' URLs (so that blah.com/mediawiki/index.php/Main becomes blah.com/wiki/Main ) by editing the mediawiki and apache config files.
First, let us consider /etc/mediawiki/LocalSettings.php On ubuntu 10 this file should already have a line like '$wgScriptPath = "/mediawiki";' To make the urls shorter, add these two lines:
$wgArticlePath = "/wiki/$1"; # what the url will look like for visitors $wgUsePathInfo = true; # enable shorter url feature
Now you can edit the apache config file ( /etc/apache2/apache2.conf or if you use vhosts, something else). Add the following 2 lines:
AcceptPathInfo On Alias /wiki /usr/share/mediawiki/index.php
Now restart apache (apache2ctl restart) and you should be able to see the shorter URLs in action.
Please see Manual:Short_URL for more information.
Other Resources [edit]
- Ubuntuguide.org provides detailed instructions for setting up MediaWiki on Ubuntu, including multiple wikis and nested subwikis.
- Kubuntuguide provides detailed instructions for setting up MediaWiki on Kubuntu, including multiple wikis and nested subwikis.