Create a Wikifarm: Difference between revisions

From SaruWiki
Jump to navigation Jump to search
Line 9: Line 9:
We'll assume you've followed the other tips in this wiki. Most notably, you've taken all steps described in the article on "how to [[Place MediaWiki inside a Virtual Host]]". The steps are simple
We'll assume you've followed the other tips in this wiki. Most notably, you've taken all steps described in the article on "how to [[Place MediaWiki inside a Virtual Host]]". The steps are simple
===Move the Wiki configuration within /etc===
===Move the Wiki configuration within /etc===
Your Wiki config file will be ''/etc/mediawiki/LocalSettings.php'', and the settings for Apache2 will be in ''/etc/mediawiki/apache.conf''. We'll create a subdirectory under ''/etc/mediawiki'' that hosts the configuration of your Wiki. Suppose we name the subdirectory after the Wiki we're handling, in this example the SaruWiki:
Your Wiki config file will be ''/etc/mediawiki/LocalSettings.php'', and the settings for Apache2 will be in ''/etc/mediawiki/apache.conf''. We'll create a subdirectory under ''/etc/mediawiki'' that hosts the configuration of your Wiki. Suppose we name the subdirectory after the Wiki we're handling, in this example the SaruWiki. Furthermore, suppose that you also have an ''AdminSettings.php'' file. If you don't: no worries! Just skip the steps involved with that file!
  cd /etc/mediawiki
  cd /etc/mediawiki
  mkdir SaruWiki
  mkdir SaruWiki
  mv LocalSettings.php SaruWiki
  mv LocalSettings.php SaruWiki
mv AdminSettings.php SaruWiki
  mv apache.conf Saruwiki
  mv apache.conf Saruwiki
Note: make sure that after moving the files, the owner and permissions are the same. Moving a file while you are ''root'' has the effect of changing ownership to ''root''. ''LocalSettings.php'' must be owned by user:group ''www-data:www-data'' in order for Apache2 to be able to read the file. The ''AdminSettings.php'' file, if it exists, must be owned by ''root:root'' and NOT be readable by world (permissions 600) because it should contain the MySQL "root" username and password, with which maintenance scripts can perform their tasks if you instruct them to (while you are root, of course).
To keep the Wiki running, we're going to need to tell Apache2 where the two files went to. In this case:
To keep the Wiki running, we're going to need to tell Apache2 where the two files went to. In this case:
* change the path to ''apache.conf'' in the ''Include'' statement in the site declaration (e.g. in ''/etc/apache2/sites-available/000-saruman.biz'', change the ''Include'' line to
* change the path to ''apache.conf'' in the ''Include'' statement in the site declaration (e.g. in ''/etc/apache2/sites-available/000-saruman.biz'', change the ''Include'' line to
  Include /etc/mediawiki/SaruWiki/apache.conf
  Include /etc/mediawiki/SaruWiki/apache.conf
* change the symlink in ''/var/lib/mediawiki'' that points to ''LocalSettings.php'':
* change the symlink in ''/var/lib/mediawiki'' that points to ''LocalSettings.php''; and if you have one, change the ''AdminSettings.php'' symlink as well:
  cd /var/lib/mediawiki
  cd /var/lib/mediawiki
  unlink LocalSettings.php
  unlink LocalSettings.php
  ln -s /etc/mediawiki/SaruWiki/LocalSettings.php
  ln -s /etc/mediawiki/SaruWiki/LocalSettings.php
unlink AdminSettings.php
ln -s /etc/mediawiki/SaruWiki/AdminSettings.php
If you now restart Apache2, your Wiki will still work - but the two primary configuration files have moved over to a dedicated spot.
If you now restart Apache2, your Wiki will still work - but the two primary configuration files have moved over to a dedicated spot.


==Adding MediaWiki instances to your farm==
==Adding MediaWiki instances to your farm==

Revision as of 18:59, 4 February 2009

What is a Wikifarm?

Types of Wikifarms

The standard Debian MediaWiki structure

Recreating (moving over) your first MediaWiki instance

We'll assume you've followed the other tips in this wiki. Most notably, you've taken all steps described in the article on "how to Place MediaWiki inside a Virtual Host". The steps are simple

Move the Wiki configuration within /etc

Your Wiki config file will be /etc/mediawiki/LocalSettings.php, and the settings for Apache2 will be in /etc/mediawiki/apache.conf. We'll create a subdirectory under /etc/mediawiki that hosts the configuration of your Wiki. Suppose we name the subdirectory after the Wiki we're handling, in this example the SaruWiki. Furthermore, suppose that you also have an AdminSettings.php file. If you don't: no worries! Just skip the steps involved with that file!

cd /etc/mediawiki
mkdir SaruWiki
mv LocalSettings.php SaruWiki
mv AdminSettings.php SaruWiki
mv apache.conf Saruwiki

Note: make sure that after moving the files, the owner and permissions are the same. Moving a file while you are root has the effect of changing ownership to root. LocalSettings.php must be owned by user:group www-data:www-data in order for Apache2 to be able to read the file. The AdminSettings.php file, if it exists, must be owned by root:root and NOT be readable by world (permissions 600) because it should contain the MySQL "root" username and password, with which maintenance scripts can perform their tasks if you instruct them to (while you are root, of course). To keep the Wiki running, we're going to need to tell Apache2 where the two files went to. In this case:

  • change the path to apache.conf in the Include statement in the site declaration (e.g. in /etc/apache2/sites-available/000-saruman.biz, change the Include line to
Include /etc/mediawiki/SaruWiki/apache.conf
  • change the symlink in /var/lib/mediawiki that points to LocalSettings.php; and if you have one, change the AdminSettings.php symlink as well:
cd /var/lib/mediawiki
unlink LocalSettings.php
ln -s /etc/mediawiki/SaruWiki/LocalSettings.php
unlink AdminSettings.php
ln -s /etc/mediawiki/SaruWiki/AdminSettings.php

If you now restart Apache2, your Wiki will still work - but the two primary configuration files have moved over to a dedicated spot.

Adding MediaWiki instances to your farm