Manual:Running MediaWiki on Debian GNU/Linux

MediaWiki installation for Debian Sarge GNU/Linux

This is the easiest way of installing MediaWiki on Debian Sarge. Remember that this installation may not be secure and ready for production purpose. It is meant to be "MediaWiki on Debian ASAP"

Core Packages
Make sure apt's package index files are synchronized:

apt-get update

You can use either Apache 1.3 or the newer Apache 2. If you are using Apache 1.3, make sure you have the following packages installed

apt-get install apache php4 libapache-mod-php4 php4-gd php4-imagick php4-mysql mysql-server
 * apache
 * php4
 * libapache-mod-php4
 * php4-gd
 * php4-imagick
 * php4-mysql
 * mysql-server

If you are using Apache 2, you need the following packages instead
 * apache2-mpm-prefork
 * libapache2-mod-php4
 * php4-gd
 * php4-imagick
 * php4-mysql
 * mysql-server

apt-get install apache2-mpm-prefork libapache2-mod-php4 php4-gd php4-imagick php4-mysql mysql-server

Sid users should be aware that apache2 2.0.53-3 does not work with MediaWiki, you should use 2.0.52-3 from testing instead.

It is possible to use Caudium instead of apache. However, you must use caudium's "PHP support" module; the "Universal script support" does not work with MediaWiki.

If you use Caudium, you must install the caudium-php4 package.

Configure Apache
Mediawiki uses the ServerName variable defined in your httpd.conf file. Make sure it is set to your website's name. If this isn't done you'll get an error that complains about not being able to connect to localhost or some other website.

Configure MySQL
Most of all you need to apply mysql root password. Remember not to use same password for system root and mysql root

mysqladmin -u root password xxxx

Now check if the password works:

mysql -u root

If you see:

ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)

Then mysql root account is now on password protected.

Configure PHP
Make sure your php configuration file (/etc/php4/apache/php.ini or /etc/php4/apache2/php.ini) has this line:

memory_limit = 20M

and the following lines uncommented:

extension=mysql.so extension=gd.so

restart apache / apache2

apachectl restart

apache2ctl restart

Get latest MediaWiki
Get the latest MediaWiki form MediaWiki SourceForge page example: wget http://puzzle.dl.sourceforge.net/sourceforge/wikipedia/mediawiki-1.3.9.tar.gz

Copy it and extract in apache root directory:

cp mediawiki-1.3.9.tar.gz /var/www cd /var/www tar vxfz mediawiki-1.3.9.tar.gz

rename the extracted directory name to wiki mv mediawiki-1.3.9 wiki

In order to configure the wiki you have to make the config subdirectory writable by the web server.

To make the directory writable on a Unix/Linux system:

cd /var/www/wiki chmod a+w config

Navigate your browser to http://localhost/wiki and continue with installation.

Pay good attention for "Checking environment..." in MediaWiki installation script. This can solve a lot of problems for your MediaWiki successful installation. Fill out the configuration form and continue.

Once configuration is done you'll need to move the created LocalSettings.php to the parent directory.

cd /var/www/wiki/config/ mv LocalSettings.php ..

For added safety you can then remove the config subdirectory entirely.

rm index.php cd .. rmdir config

And navigate your browser to http://localhost/wiki to see your new wiki. Done!

TeX Support
You need these packages installed: apt-get install ocaml imagemagick gs cjk-latex tetex-extra php4-imagick After installation, enable inline LaTeX equations by uncommenting: $wgUseTeX          = true; in LocalSettings.php file.
 * ocaml
 * imagemagick
 * gs
 * cjk-latex
 * tetex-extra
 * php4-imagick

Make sure your php.ini contains the following row:

extension=imagick.so

Next compile texvc in your math directory:

cd /var/www/wiki/math make

You may have to manually create the directories for math temp and output directories:

cd /var/www/wiki/images mkdir -m777 math tmp

read math/README for further detailed instructions.