Manual:Installation

Installation instructions are hard to find, I know they are here somewhere. --Anonymous mediawiki's handbook reader

Prerequisite tools
To install MediaWiki you need four components:
 * MySQL - an SQL database to store the Wiki text, user list etc.
 * Apache - a web server to serve the HTML web pages
 * PHP - the programming language that MediaWiki is written in. Fedora/Redhat users will also need the PHP-Mysql package.
 * MediaWiki itself, which is a suite of programs written in PHP

Minimum system requirements
Slow performance has been reported on systems where the whole site is on a single Pentium 133 with 48MB of RAM. 256MB is the recommended minimum amount of RAM for a single computer site but you're certain to need more for a busy public site. The Wikimedia Apaches typically have 512MB to 1GB and the databases servers 4GB.

1. download and uncompress(untar) the Wikipedia Files
Download the tarball setup file from: http://www.sf.net/projects/wikipedia

2. Upload them to your servers
Untar the file on your local machine and upload it into the web accessible folder (this is usually the htdocs directory on Apache webservers). You can place it in the root and if you have access to the httpd.conf, setup a symlink.

If you are using a hosting company, it is usually worth creating a directory under the /www/ folder in the filesystem, such as /wiki and upload all the files from your local drive into this folder.


 * Note: The pack includes a lot of files, spread over dozens of directories. Be careful when uploading. If the ftp accuses connection timeout it might mean that there will be a file missing. Sometimes you'll have to re-upload many times, specially if you have a slow conection. It's messy.

3. Create MySql
If you don't have root access, you will need to create a MySQL database and a user for the database at your local host. To create it ask your site's hosting company.

If you have root access, the setup file will ask you for the root password and automatically setup the database for you.

4. Change folders permissions
cd into the directory where the mediawiki files are. You will find index.php and the config directory. chmod o+w config directory (yes! this needs to be done).

For those of you who do not know what this means, you will need to set the permissions (chmod) of the config directory to 777 so that it is world writable.

See your FTP client's instructions to figure out how to set permissions (E.g.: with the "Core FTP" client you simply right click on the config directory and select properties. A dialogue box will appear and easily allow you to change permissions to 777).

This can often be done by heading into your web host's control panel, and then into the file manager. If you are not allowed to set the permissions to 777, try setting it to 755 or 775 instead.

5. Visit your site
Visit the directory that wiki resides in. For example: if your domain is example.com and you are installing wiki in a folder called wikimedia, you will need to access http://example.com/wikimedia/ as this will lead you to the install page.

6. Answer questions

 * fill in your desired wikidb name etc
 * wiki site name
 * licence metadata
 * database username
 * database name
 * database root password (you may not have this, this is the nice way to go, if you don't have this, you have to use another set of tools to create your db and username, or just tag tables on with another webapp!)

and submit.

If you are using a hosting service, please note that the database name and database username have a prefix (normally the userid given by your hosting provider). For example, if you have created a database named db01 with username u01 and your userid is ocom (given by your hosting provider), you should enter the database name and database username as ocom_db01 and ocom_u01 respectively.

7. copy LocalSettings.php
After setup, a file called LocalSettings.php is created in the config folder. You will need to copy this file to the main wiki parent folder.

8. Set back permissions - IMPORTANT
chmod o-w config You will need to set the permissions (chmod) the config directory to 0600 so that only the owner can read and write to this file. It is important that this is done because not doing it will lead to security risks.

Question - The LocalSettings.php file is created by the web server with a+w permissions. Is it a security risk to leave it writeable by all users, or even the web server?

Guess? - Mine was just created 644, maybe this was changed/fixed or specific to your os / apache setup?

I believe it is not a security risk. If the permission is not 644, for instance 600 or so, then the web server would not be able to read the wiki's configuration. (the webserver runs with the permission "other")


 * If you move it instead of copying it, then it will be writable by the web server. It may indeed be safer, especially on a multiuser server without safe mode restrictions, to make it owned and writable only by yourself. It must however be readable by the web server or the system doesn't work. --brion 03:52, 27 Feb 2005 (UTC)

9. customize style sheet
You can customize the logo up the top left hand side by replacing either stylesheets/images/wiki.png or stylesheets/monobook/images/wiki.png

On my copy of 1.4beta5 this was skins/common/images/wiki.png.

However a better way to change it would be to use LocalSettings.php. It's in there somewhere.

One problem with this is I'm not sure what size the css is set for, so your picture may look cropped.

=> the size of wiki.png 135x135 px