Hackathons/Laptop setup/Linux MediaWiki

These instructions assume you are running Ubuntu or Debian. If you are running Fedora or another similar system, you should contact a staffer and get help. (Raise your hand!)

Make space in the Apache directory
In a terminal, type the following commands.

Note: You have to copy these instructions carefully -- capital letters matter!

sudo mkdir /var/www/wiki sudo chown $USER /var/www/wiki

Get MediaWiki via git
In a terminal, type these commands. This clones the latest development code on MediaWiki into your wiki directory.

cd /var/www git clone https://gerrit.wikimedia.org/r/mediawiki/core.git wiki

This will take a while. As it downloads, introduce yourself to a neighbor!

Switch to a different branch of the code
Rather than run whatever is the latest code that has been added to the MediaWiki repository, we encourage you to run a released version of MediaWiki. To do that, run this in the terminal:

cd /var/www/wiki git checkout origin/REL1_19 -b mywiki

This creates a branch called mywiki based on the MediaWiki 1.19 release, and switches you to that branch. (If that seems like gobbledygook, that is okay for now.)

Make a shortcut in your home directory
For convenience, if you have a directory where you usually put software development projects, you can create a "symbolic link" so that you can access the wiki from there. This makes the wiki code easier to find.

For example, if you normally store your work in a "projects" folder within your home directory, type these commands in a terminal.

First, switch back to your home directory with this command

cd

Then, cd into your projects directory:

cd projects

(If this complains that there is no such file or directory, run the following command: mkdir projects)

Finally, create the link:

ln -s /var/www/wiki wiki

Now you can access the wiki via $HOME/projects/wiki/.

Set up the wiki
With the wiki code in place, now is a good time to perform an installation of the wiki. This step is the easiest.

/var/tmp wiki-database.db
 * Visit http://localhost/wiki/mw-config/ in a web browser.
 * Make sure a Continue button appears at the end. Click it!
 * The installer will ask you which Database type you want. Choose SQLite.
 * For the SQLite data directory, enter:
 * For the database name, enter this:

Note: We use /var/tmp to store the database, which on Ubuntu, Debian, and Fedora, should never be automatically cleared. However, some people configure their systems to delete data stored in that directory. If you know that you have configured your system to clear that directory, choose a different one. (We chose that directory because of the easy-going permissions that directory has.)


 * Choose whatever you want for the following options:
 * Name of wiki (Suggestion: "Mywiki")
 * Your name
 * Password
 * Password again
 * E-mail address
 * Check the box labeled "I'm bored already", then click Continue.
 * Click Continue once more, to install the wiki!
 * Click Continue yet once more, for some reason.
 * The web app will offer you a LocalSettings.php file. The browser will ask you where you want to save it. Navigate to /var/www/wiki/ and save the file there.

Make sure your wiki works
If all went well, now when you go to http://localhost/wiki/, you will see a friendly message that tells you:

"MediaWiki has been successfully installed."

Congratulations! Log in with the username you just created to make sure it works.

If something did not work, do ask a staff member for help!

Return to laptop setup
&laquo; Return to laptop setup