Manual:Installation

<-MediaWiki User's Guide

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
 * MediaWiki itself, which is a suite of programs written in PHP

These notes were written from an installation on Windows 2000. (Please add corresponding Unix directories, commands etc.)

Documentation

 * Apache, Apache 2.0, and FAQ
 * MySQL
 * PHP
 * MediaWiki User's Guide

Latest versions

 * MySQL 4.0 (These notes written from version 3.23)
 * Apache 2.0.44
 * PHP 4.3
 * MediaWiki 2003/08/29

MySQL

 * Download the latest version of MySQL from www.mysql.com/downloads
 * Extract it into a temporary directory
 * Run setup.exe to install (installs into MySQL directory e.g. c:\mysql
 * Add a password for the root user
 * The following example starts by removing the anonymous user that has all privileges, then sets a root user password (Instructions copied from www.mysql.com/doc/en/Default_privileges.html and www.mysql.com/doc/en/Windows_running.html):
 * From DOS in C:\mysql\bin\mysql
 * mysql
 * DELETE FROM user WHERE Host='localhost' AND User= '';
 * QUIT
 * C:\mysql\bin\mysqladmin reload
 * C:\mysql\bin\mysqladmin -u root password your_password
 * Run bin\winmsqladmin.exe to configure and start mysql
 * To test that the installation was successful
 * Run bin\mysql.exe to open MySQL prompt
 * use test
 * create table test_table (test_id int, test_note text);
 * select * from test_table;
 * show tables; -- list all tables in database
 * describe test_table;
 * show index from test_table; - info on index
 * exit

Apache

 * Download the latest version from httpd.apache.org/download.cgi, using one of the mirrors.
 * e.g. for Windows, I downloaded from apache.planetmirror.com.au/dist/httpd/binaries/win32, but you should use whichever mirror is assigned
 * you probably want the "x86-no_ssl.msi" version
 * e.g. apache_2.0.44-win32-x86-no_ssl.msi
 * Change the Apache configuration file httpd.conf (located in C:\Program Files\Apache Group\Apache2\conf)
 * Change administrators email address to your own
 * change the line begining with ServerAdmin to ServerAdmin Me@company.com
 * Pick a different port for Apache to use other than the default 80
 * change Listen 12.34.56.78:80 to Listen 8000
 * if you don't do this step correctly, you will get the message No installed service named "Apache2". when you do the next step
 * Change the ServerName localhost
 * change the line ServerName localhost to ServerName 127.0.0.1:8000 (as per suggestions at www.sitepoint.com/article/305/2)
 * Install into C:\Program Files\Apache Group\
 * from the command line, enter C:\Program Files\Apache Group\Apache2\bin>apache -k install (as per notes at httpd.apache.org/docs-2.0/platform/windows.html#winsvc)

PHP

 * Download the latest version from www.php.net
 * e.g. for Windows, I downloaded from www.php.net/get/php-4.3.0-Win32.zip/from/us4.php.net/mirror (although this is not latest version)...
 * Unzip to a suitable directory e.g. C:\PHP4
 * Rename php.ini-dist to php.ini and copy it to C:\WINNT (not C:\WINDOWS).
 * Copy php4ts.dll to the C:\WINNT\System32 directory
 * Change httpd.conf to make it aware of PHP
 * ScriptAlias /php4/ "C:/php4/"
 * AddType application/x-httpd-php .php .phtml
 * AddType application/x-httpd-php-source .phps
 * Action application/x-httpd-php /php4/php.exe
 * Create phpinfo.php file in DocumentRoot (e.g. C:/Program Files/Apache Group/Apache2/htdocs) as a simple text file containing:
 * phpinfo;
 * phpinfo;


 * Change the error reporting level (if not running on Windows or you get errors like this: "PHP Notice: Undefined index:  HTTP_ACCEPT_CHARSET in OutputPage.php on line 388")
 * Change php.ini from
 * error_reporting = E_ALL
 * to
 * error_reporting = E_ALL & ~E_NOTICE
 * This will display all output except notices (which often display during normal processing)
 * To see PHP configuration details (quite a lot of it!), browse to localhost:8000/phpinfo.php

MediaWiki

 * Download the latest stable version of mediawiki-20030829.tar.gz from sourceforge.net/projects/wikipedia/
 * Install by running c:\php4\php c:\wiki\mediawiki-20030829\phase3\install.php
 * the install will ask at one point for the MySQL root password which is the one you set up above (???on Windows it will not: You must first create the files LocalSettings.php and AdminSettings.php)
 * If installing on Windows (rather than Unix)
 * Create session subdirectory under c:\php4 i.e. c:\php4\session
 * Change c:/php4/php.ini
 * session.save_path = "C:/PHP4/session" ???(there's already a entry to sessiondata, do i really have to change that?)
 * In C:\wiki\mediawiki-20030829\phase3
 * Copy LocalSettings.sample to LocalSettings.php and customize it for things like local paths. (??? How do I do that in Windows? I have a problem with the Windows notation: "c:\...\..." . The install.php files takes endless)
 * Copy LocalSettings.php to C:\Program Files\Apache Group\Apache2\htdocs\wiki
 * Copy AdminSettings.sample to AdminSettings.php and customize it with the admin userid and password.
 * Do not copy AdminSettings.php (for security reasons as mentioned in its comments)
 * Browse to localhost:8000/wiki/wiki.phtml

That completes the basic installation!

Rewrite Rules
Nicer urls with Apache rewrites; for example  http://my.url/mytitle .

Optional tweaks

 * Enable phptal & smarty Skins
 * Enable Interwiki links
 * If you are running your own Wiki, rather than just using this installation for an offline copy of Wikipedia
 * In C:\Program Files\Apache Group\Apache2\htdocs\wiki
 * Set $wgSiteName in LocalSettings.php to your site name, rather than "Wikipedia" which is the default
 * In C:\wiki\mediawiki-20030829\phase3\languages
 * Make a backup copy of Language.php
 * Change Language.php to replace some of the text with your versions e.g. you may use a different license
 * Copy Language.php to C:\Program Files\Apache Group\Apache2\htdocs\wiki
 * install mod-rewrite to display urls better etc... (to be documented)
 * If desired, update FulltextStoplist.php from the MySQL sources if you have customized MySQL's stop list.

Updates
To update from one version of MediaWiki to another
 * do these steps...