Creating a MediaWiki Development Environment

Revision as of 13:53, 7 April 2012 by Srevilak (talk | contribs) (→‎Setup a Virtual Host: typo)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Creating a MediaWiki development environment

Obtaining the Source

git init
git remote add origin ssh://
git fetch origin
git checkout master

Here's what the result should look like.

$ ls
total 8
4 mediawiki/  4 robots.txt

The "mediawiki" directory will be your document root.

Setup a Virtual Host

Add an IP/hostname mapping to your hosts file (e.g., /etc/hosts). For example:     obwiki.local

Add a virtualhost to your web server. For example:

 <VirtualHost localhost:80>
   ServerName obwiki.local
   DocumentRoot /PATH/TO/

Initial Wiki Install

Go to http://obwiki.local; click "set up the wiki".

Go through the wiki installation process. I'll assume that you're using MySQL, a username of "obwiki", and a database name of "obwiki".

Don't worry too much about the initial configuration parameters. We'll set up the confgiuration in a subsequent step.

At the end of the installation, MediaWiki will ask you to save a LocalSettings.php file. Save this file as LocalSettings-install.php.

Configuration Setup

cd mediawiki   # this is the document root
cp LocalSettings-example.php LocalSettings.php

Now, edit LocalSettings.php. Fill in the values from LocalSettings-install.php.

Noteworthy Configuration Directives

If you'd like to use mod_rewrite, add the following to your webserver's virtualhost definition:

   RewriteEngine On
   RewriteRule ^/*$ http://obwiki.local/wiki/Main_Page [L]
   RewriteRule ^/?wiki/(.*)$ /index.php?title=$1  [PT,L,QSA]

If you don't want to use mod_rewrite, add this line to LocalSettings.php

 $wgArticlePath = false;

You may also want to add

 $wgUseSquid = false;

Additional Setup for Plugins

We enable several MediaWiki plugins, and some of these plugins require additional database tables. To install the additional database tables:

cd mediawiki
php maintenance/update.php

At this point, you should be able to create and edit pages in your development environment.

Miscellaneous Notes

If you'd like to look at boggs server configuration for, you'll find it in ~obwiki/

The live document root is ~obwiki/ Note that this is a checked out copy of git repository.