Manual:Wiki family

This page should lead you through the installation and configuration of a small wiki-family.

Scenario 1: Unix-based operational system shared-hosting provider
You have a wiki installed in an Unix-based operational system shared-hosting provider. See the solution, including step-by-step detailed instructions: http://www.steverumberg.com/wiki/index.php/WikiHelp For a smaller guide and simpler solution, see Scenario 2, below.

Scenario 2: Quick set-up
You want to install more than one wiki on a single server, using the same source code, and using the same database?


 * 1) Install MediaWiki and additional tools as usual
 * 2) Set up your wiki (e.g., MyWiki)
 * 3) After successful installation, move LocalSettings.php into the root directory of your wiki and rename it in such a way to make it easy to track (e.g., myWikiLocalSettings.php)
 * 4) Repeat the steps above for each wiki you wish to create, with suitable local setting files (e.g., anotherWikiLocalSettings.php, etc.)
 * 5) Change the $wgScriptPath variable in your settings files to the required URI prefix. (e.g., wiki1, etc.)
 * 6) Create a LocalSettings.php file for your global settings, then select one from the two possibilities below:
 * 1. If your wikis are in different directories or subdomains linked to the same directory on your server, use this:


 * Note: strpos returns 0 if the string you search for in $callingurl is found at the beginning of $callingurl, therefore, you need to change if(strpos($callingurl,'wikiN')) to if(strpos($callingurl,'wikiN') !== FALSE).
 * OR 2: If you have different domains that link to one directory on your server, use this:

You can use a different unique MySQL database for each wiki (see $wgDBname) OR you can use a different table prefix for each wiki (for Postgres, you can achieve a similar effect by using different schemas) (see $wgDBprefix).

To link your subdomains to one directory on your server you may have to edit the configuration file for your server (can not be done with a .htaccess file) or modify the DNS configuration for your site (if your site has its own IP address).

Scenario 3: Drupal-style sites
As above, this setup allows you to install more than one wiki on a single server, using the same source code. This setup has the advantage of being completely transparent to users and reasonably secure in terms of the images directory.


 * Create a base directory to contain all your MediaWiki files e.g.,.
 * Install MediaWiki and additional tools as usual to a version-declaring subdirectory(e.g., /home/web/mediawiki/mediawiki-1.10.0).
 * Link the version-declaring directory to a code directory. e.g.,
 * Create a sites directory to contain our images and settings:
 * Setup the wiki as normal from the /code directory.
 * After successful installation, move LocalSettings.php into a sites directory that will be a match when the site is checked. For example, to capture http://mysite.com/mywiki, one would create the directory mysite.com.mywiki. e.g., . See the Drupal's settings.php file for more information on this.
 * If you intend to use media files, create an images directory in your site directory. e.g., . Make it writable as necessary.
 * Place the Drupal-style LocalSettings.php file in your main directory:
 * Modify your LocalSettings.php to point to the right places. The following modifications deserve special attention:

 ServerAdmin me@myserver.com DocumentRoot /home/web/wiki.mysite.com ServerName wiki.mysite.com CustomLog /var/log/apache2/wiki.mysite.log common # Alias for Wiki so images work Alias /images /home/web/mediawiki/sites/wiki.mysite.com/images # If you want to password protect your site #  #   AuthType Basic #   AuthName "My protected Wiki" #   AuthUserFile /etc/apache2/htpasswd/users-mywiki #  require valid-user #  
 * Prepare your Apache 2 installation. Example site: wiki.mysite.com
 * ln -s /home/web/mediawiki/code /home/web/wiki.mysite.com
 * Create an appropriate VHost configuration:

The site should now work. In my case, I made another copy of the code from which to install and update my LocalSettings.php and databases.

Scenario 4: Multiple wikis sharing common resources
You want to have some wikis in different languages, sharing the same media-files in another, single wiki.

For example:


 * en.yourwiki.org - English language
 * fr.yourwiki.org - French language
 * de.yourwiki.org - German language
 * pool.yourwiki.org - media-files for all of these wikis (like Commons).
 * As there is already an Interwikilink named commons for Wikimedia Commons, we name our media-files-wiki "pool".
 * Think before being creative; if you call your media-files-wiki something like "media" (e.g. media.example.com), it might collide with internal namespaces and nomenclature for embeddind media files ( [[media:file.ext]] ).

Install
On your filesystem, create a folder for each wiki. Run the install script for each wiki. (This solution duplicates source code.)

Interwiki
Now you have to set Interwikilinks between all wikis, by editing their MySQL-Databases (if you prefer, install and use Extension:Interwiki)
 * Table Interwiki
 *  iw_prefix - enter the language-code of the wikis, "de" for German, "en" for English, "fr" for French and "pool" for the mediapoolwiki
 *  iw_url - this is the place for the complete URL to the wikis, e.g. " http://de.yourwiki.org/index.php/$1 " for the German wiki (don't forget the "$1" !).

Now you can link an article to the same in another languages. Adding Hauptseite on your English Main_Page will create a link "Deutsch" (under the Navigation bar) which leads to the Main_Page of the German wiki (Hauptseite). For further information visit Help:Interwiki linking

Upload
Make sure that folder "images" of the pool-wiki is writable.

It is useful to change the "Upload file"-Link of the language-wikis to point to poolwiki's upload-site. Open the "LocalSettings.php" of each language-wiki and add:

Use shared files
To use poolwiki's files in the languagewikis, open "LocalSettings.php" for each languagewiki and add:

Now you can integrate pool's files with (e.g.) in the languagewikis.

Image description
In each languagewiki, open (as an admin) the message MediaWiki:Sharedupload.

Change the text to something like: This file is stored in our data-pool. For information and description, please visit the

description there. (And note the ':' at the beginning of the line, which stops 'pool' from being included in the interwiki list at the left of the page.)

If you want to output the media-description, stored in the PoolWiki, too, add to the "LocalSettings.php" of the languagewikis:

Shared Settings
If you have multiple wikis, you'll probably want to share similar settings across them all. Here is how to do that. We recommend that you separate your Extension settings into a different file than your other settings, as detailed below. They can be all put into one large file, but it's not as flexible depending upon your specific needs.

Here is an example directory structure if you do all of the following: en/ es/ pl/ ja/ pool/ ExtensionSettings.php WikiFamilySettings.php SharedMediaSettings.php

Extension Settings

 * Step 1
 * Create a file called ExtensionSettings.php with the following contents, and place it in a location similar to the example above.
 * Step 2
 * Edit the LocalSettings.php file of each wiki that you want to use the shared settings, and add the following.
 * Step 3
 * Now just add all the references to your various extensions

Wiki Family Settings
These are settings that you want to apply to the entire wiki family. For example, maybe you want to be able to easily put all the wikis into read-only mode at the same time. You can also store the username/password for the database(s), if they are all the same. Additionally, you could control user permissions across your entire wiki from this one file.

Note: If you use a Images/Media commons or pool, we recommend that you not put these settings in the WikiFamilySettings.php file. That information only applies to every wiki in your wiki family other than your repository. We recommend putting it in a separate file.

Ultimate minimalist solution
The ultimate minimalist solution consists of symlinks, aaaa.example.org -> mediawiki bbbb.example.org -> mediawiki cccc.example.org -> mediawiki and in : Note that we are still able to individually $ cd aaaa.example.org/maintenance && php update.php etc. vital tasks. Indeed, we might even have mediawiki -> mediawiki-1.11.0, etc.