Manual:Running MediaWiki on Red Hat Linux

Introduction
This article is aiming to giving detailed instructions for peopel who want to run MediaWiki on a Red Hat Linux platform.

Red Hat Linux 9.0
Though this version of Red Hat Linux is obsolete someway, it is still useful to give help for it.

Most operations require root permission. Be sure to su as the root if permission problems occur.

Preparing
There are graphic rpm package management tools in this Linux distribution. type 'redhat-' followed by 'Tab' key to see what are available in your system [root@localhost root]# redhat- redhat-cdinstall-helper           redhat-config-rootpassword redhat-config-date                redhat-config-securitylevel redhat-config-keyboard            redhat-config-services redhat-config-language            redhat-config-soundcard redhat-config-mouse               redhat-config-time redhat-config-network             redhat-config-users redhat-config-network-cmd         redhat-config-xfree86 redhat-config-network-druid       redhat-control-network redhat-config-packages            redhat-install-packages redhat-config-printer             redhat-logviewer redhat-config-printer-gui         redhat-update-gnome-font-install redhat-config-printer-tui         redhat-update-gnome-font-install2 redhat-config-proc We need to update all software packages used by MediaWiki in this system. 'redhat-config-packages ' is a good GUI tool for us to uninstall them first. But if you are an expert in rpm, ignore this part.

If you cannot find this tool, using the following command to install it   rpm -ivh redhat-config-packages

Uninstall httpd,mysql, and php
Run the package configuration GUI tool by:

[root@localhost root]# redhat-config-packages

Uncheck anything rpm packages related to httpd, mysql, and php

Install mysql
make sure there is no previous version of mysql installed in your system by rpm -q mysql

If there is none, proceed to install phase, otherwise uninstall it by rpm -e mysql uninstall any rpms dependent on mysql using the same method too.

Download rpm packages for mysql's server, client and dynamic shared libraries. You can easily search 'mysql' in http://www.google.com for latest rpm packages.

For example: Then install them one by one, using rpm -ivh MySQL-server-4.0.20-0.i386.rpm rpm -ivh MySQL-client-4.0.20-0.i386.rpm rpm -ivh MySQL-shared-4.0.20-0.i386.rpm
 * MySQL-server-4.0.20-0.i386.rpm
 * MySQL-client-4.0.20-0.i386.rpm
 * MySQL-shared-4.0.20-0.i386.rpm

Initialize mysql database after installation by typing mysql_install_db Following other instructions from mysql doc to change the default empty password for mysql users to what you like

Don't forget to set the mysqlclient.so path into search path /etc/ld.so.conf file. For example, we have: /usr/lib/libmysqlclient.so Make sure /etc/ld.so.conf contains: /usr/lib Then run /usr/sbin/ldconfig The path is necessary because /usr/sbin is not in command path by default, I guess.

Install apache web server (httpd)
google apache to find the latest source ball. In my case, I used httpd-2.0.50.tar.gz

Untar it

cd httpd-2.0.50 ./configure --enable-so make make install

Now you have Apache 2.0.50 available under /usr/local/apache2, configured with loadable module support and the standard MPM prefork.

To test the installation use your normal procedure for starting the Apache server, e.g.: /usr/local/apache2/bin/apachectl start

In your web browser, access your own machine by address: http://localhost And I am sure you will be proud of what you see now!

and stop the server to go on with the configuration for PHP: /usr/local/apache2/bin/apachectl stop.

Install PHP
google php to find the latest php source package. In my case, I used php 4.3.8

php-4.3.8.tar.gz

untar it ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql make make install

There is some warning about using built-in sql support from PHP, I will figure it out later. But this time, let it be as a quick solution.

We need to configure apache web sever after the installation by editing httpd.conf cd /usr/local/apache2/conf vi httpd.conf Make sure you see the following line without # in front of it. LoadModule php4_module       modules/libphp4.so

Tell Apache to parse certain extensions as PHP by adding lines into httpd.conf, you may search the file by /AddType first to find the proper place. AddType application/x-httpd-php .php .phtml AddType application/x-httpd-php-source .phps

Install MediaWiki
We are almost done! download MediaWiki package, I am using mediawiki-1.3.2.tar.gz tar xzvf mediawiki-1.3.2.tar.gz cp mediawiki /var/www/wiki You may change the name and directory as your wish.

Change apache www root to wiki directory by editing

vi /usr/local/apache2/conf/httpd.conf #DocumentRoot "/usr/local/apache2/htdocs" DocumentRoot "/var/www/wiki" And adding wikipedia's index.php into web server's default first page list by expanding the following line DirectoryIndex index.html index.html.var index.php Save and quit, Start apache server by /usr/local/apache2/bin/apachectl restart

Test what you have achieved by access http://localhost

WOW!!!