MediaWiki:Config

Some configuration notes about our installation.

=Apache=

Note that subversion needs Apache2 to run properly. We use the standard install from RedHat. The apache2 server (httpd) is stopped started and restarted as follows:

/etc/rc.d/init.d/httpd stop /etc/rc.d/init.d/httpd start /etc/rc.d/init.d/httpd restart

The Apache configuration file is located at /etc/httpd/conf/httpd.conf.

The only modifications done were:


 * AcceptPathInfo to beautify MediaWiki's URLs:
 * 1) AcceptPathInfo is required for the nice URLs in the wiki so that
 * 2) requests to /wiki/Page send to /w/index.php?page=Page

AcceptPathInfo on

Alias /wiki /var/www/html/w/index.php Alias /index.php /var/www/html/w/index.php
 * Two aliases to beautify Mediawiki's URLs
 * 1) Aliases for the wiki to get nice URLs

=PHP= The standard PHP install from RedHat is just fine too although we also need php-mysql for MediaWiki (see the section on MySQL below). To speed-up the websites, a PHP cache program (eaccelerator) has been installed. This is described below.

=Subversion=

subversion.conf
The subversion RPMs were downloaded from the subversion website. A copy of the relevant RPMs is still stored in /root/RPMs.

The configuration of the Apache server for subversion is kept in the file /etc/httpd/conf.d/subversion.conf:

The repositories are in /home/subversion and /home/subversion-open (and not in /var/www/html). They belong to the apache user. The access rules are in /var/www/credentials/subversion-rules</tt> and the users in /var/www/credentials/htpasswd-users</tt>. Note that both files belong to the apache</tt> user. We require authentification for everybody (i.e. there is anonymous read access). This is something that we might change in the future.

Creating new repositories
To create a new repository, log in as apache</tt>, create a new directory in /home/subversion</tt> with the right name and then use svnadmin</tt> to make this directory a subversion repository:

su apache cd /home/subversion mkdir newproject svnadmin create newproject

Managing users
The password file is /etc/svn-users</tt> and belongs to the apache</tt> user. To create new users, log in as apache</tt> and use the htpasswd</tt> command. Basically:

htpasswd /etc/svn-users newuser     # to add a new user htpasswd -D /etc/svn-users olduser  # to delete an old user htpasswd /etc/svn-users existinguser # to change the password of an existing user

We keep a log of all subversion users in the root account of source (/root/</tt>). Use open.sh</tt>, enter the key and then look at the USER-tmp</tt> file. To close it, use close.sh</tt>.

Tweaking access rules
The access rules are in /var/www/credentials/subversion-rules</tt>. This file belongs to the apache</tt> user. The syntax is very simple and almost self-explanatory. Refer to the Subversion RedBook for details.

=WebSVN= WebSVN is installed in <tt>/var/www/html/websvn</tt>. It is acually a working directory of the WebSVN trunk. For some reason, newer updates do not seem to work anymore so be careful. The configuration file is <tt>/var/www/html/websvn/include/config.inc</tt>. Not much has been changed from the default:...

$config->setEnscriptPath("/usr/bin/"); $config->setSedPath("/bin/"); $config->parentPath("/home/subversion"); $config->setTemplatePath("$locwebsvnreal/templates/UOB/"); $config->useAuthenticationFile("/etc/svn-rules"); $config->allowDownload; $config->setMinDownloadLevel(1); $config->useEnscript;

dagw 09Oct09 Looks like the current setup uses: <tt>/var/www/html/websvn/include/config.php</tt>

$config->parentPath('/home/subversion'); $config->parentPath('/home/subversion-open'); $config->setTemplatePath("$locwebsvnreal/templates/calm-custom/"); $config->useFlatView; $config->useAuthenticationFile('/var/www/credentials/subversion-rules'); // Global access file $config->allowDownload; $config->setMinDownloadLevel(2); $config->useEnscript; set_time_limit(0); $config->expandTabsBy(8);

It looks like the WebSVN interface is not used much as it is much more convenient to use a real client. Nonetheless, the RSS and download links are interesting.

=Mediawiki=

Base
MediaWiki is installed in <tt>/var/www/html/w</tt>. It is only a set of php scripts that was copied in this directory.

MySQL
As root: up2date mysql up2date mysql-server up2date php-mysql

It looks like there is an issue with the redHat version of MySQL and some backp scripts provided by MediaWiki. Not a big deal so far as we backup "manuall" but an issue to keep in mind.

The <tt>mysqld</tt> daemon must also be started:

/etc/rc.d/init.d/mysqld start

Apache
See main section above.

LocalSettings.php
The MediaWiki configuration is kept in <tt>/var/www/mediawiki/LocalSettings.php</tt>. The modifications are fairly straightforward except maybe creating custom groups (see below).

MySQL
Deatils of the MySQL database used by the wiki:

Email setup
This will probably break sometimes in the future when the University pushes everybody to use their authenticated SMTP server. We will have to find another solution then.

It broke, no surprise there so instead of using the central smtp server, we are now using the local relay

Custom groups
Creating custom groups is done in four steps:

Create a new namespace
In <tt>LocalSettings.php</tt>, define a new namespace number and it's associated "Talk" namespace:

Create a new group
Create a new group and associate a right to it in <tt>LocalSettings.php</tt>:

Associate the group and the namespace
Mediawiki was not create to allow much restriction, so you can either restrict every thing, or nothing at all. One can modify the code to allow admins to restrict areas of the wiki to certain user groups (and this is the way it was done previously) but this means that upgrading the mediawiki software becomes more delicate as one need to remodify the source every time. So now we are using the Lockdown extension. This adds a few variables to the syntax which enables us to lock certain namespaces to user groups:

Create content in the new namespace
Now the hidden/protected pages need to be created in the new namespace so use the following syntax: <tt>http://source.ggy.bris.ac.uk/wiki/NAMESPACE:New_Page</tt>

Extras requirements

 * Adding images needs ImageMagick support (<tt>up2date imagemagick</tt>)
 * Latex support needs
 * ImageMagick (see above)
 * tetex-latex (<tt>up2date tetex-latex</tt>)
 * tetex-dvips (<tt>up2date tetex-dvips</tt>)
 * ocaml (rpm in <tt>/root/RPMs/</tt> folder but requires tcl and tk, both available through up2date.
 * then, you need to type make in the <tt>math/</tt> directory to create the executable.

=eaccelerator= As Mediawiki is quite CPU intensive, it is very advantageous to cache the php scripts in compiled form so that execution is faster. This is done on source via the eaccelerator program. The speed-up is very impressive.

Instalation
Download the right RPM (Redhat EL3, x86) from. One copy (<tt>php-eaccelerator-4.3.2_0.9.3-4.1.el3.rf.i386.rpm</tt>) has been saved in <tt>/root/RPMs/</tt> on <tt>source</tt>. Install the RPM, as root:

cd /root/RPMs rpm -i php-eaccelerator-4.3.2_0.9.3-4.1.el3.rf.i386.rpm

That's it! You need to restart <tt>httpd</tt> though: /etc/rc.d/init.d/httpd restart

Configuration
The configuration options are kept in <tt>/etc/php.d/eacceletator.ini</tt>.

Eaccelerator is switched on and configuration is fine by default (i.e. no editing of the file). If you modify this file, you probably need to to restart <tt>httpd</tt> too.

Statistics
To check that eaccelerator is actually used, point your browser to the check_php.php script. eaccelerator should be mentionned somewhere next to the Powered by Zend logo. The interface is definitely snappier so you'd notice if it's not there.

To see what is actually cached by eaccelerator, point your browser to the check_eaccelerator.php script. Note that eaccelerator should cache Mediawiki and WebSVN scripts.

=cvs2svn=

To convert a CVS repository into a Subversion dumpfile: cvs2svn --dumpfile=<path/to/dumpfile> <path/to/cvs-repos>

Note: <tt>cvs2svn -help</tt> and <tt>--dry-run</tt>

To load a dump file into a new repository: svnadmin load <path/to/svn-repos> <

=Backup strategy= <tt>source.ggy.bris.ac.uk</tt> (the machine) is fully backed up by the departmental backup system. However, we felt that because of the importance of what is hosted on this machine, we should be extra cautious and back it up by another mean too.

Requirements
The following need to be backed up on <tt>source</tt>:
 * subversion repositories (daily incremental back-up and weekly full backup)
 * MediaWiki MySQL table (daily back-up)
 * MediaWiki uploads directory (daily back-up)

On <tt>source</tt>
<tt>cron</tt> jobs run on <tt>source</tt> for the <tt>apache</tt> user. They run a series of scripts (bash and perl) located in <tt>/home/apache/script/</tt> which perform the relevant backup duties and store it in <tt>/home/apache/svn-backup</tt> and <tt>/home/apache/mysql-backup</tt>

On source2 they run as root and backup to <tt>/home/root/mysql-backup</tt> etc.

On <tt>dylan</tt> <tt>eocene</tt>
JP has a series of <tt>cron</tt> jobs running on <tt>dylan</tt> which copy the backed-up content on <tt>source</tt> straight to <tt>/gsa25/rgg00s/ggjpr/source-backups</tt>

Now an rsync with <tt>eocene</tt> by Gethin to <tt>/home/ggdagw/source-backup</tt>.