WikiHelp

From MyCambrian

Jump to: navigation, search

Contents

How to Create Another Mediawiki on the Same Server, Using the Same Source Code, Using the Same Database, but with its own Tables

Scenario

You have successfully installed Mediawiki and now want to create another, separate wiki on the same server using new tables but within the same database and using the same source code.

Example

Visitors to your site www.website.com are presented with MyFirstWiki. You want visitors to www.website.com/anotherwiki to be presented with an entirely different wiki. However, you want to have a single set of source code for both wikis, and you want to keep the tables for both wikis separate but within the same database.

Level of expertise required

For method #1, you'll do some basic PHP editing and I've commented the code, so it's easy.

For method #2, if you can get to a Unix operating system prompt and type in a few basic Unix commands, you'll be fine!

Time required

Because I spent my entire evening documenting this for you, it'll take you only 15 minutes. Give a little, get a little, right? It makes the world a nicer place :-)

Two Methods

There are now two methods for accomplishing this:

Method 1: You specify which wiki to display by passing a parameter to the index.php file, like this:
index.php?w=SomeCode
To implement this, you modify the LocalSettings.php file. Cookies must be enabled. Very easy.
Method 2: You start the wiki as usual, like this:
index.php
To implement this, you use the Unix "link" command to create a fake copy of the wiki files. The operating system thinks you have two wikis installed (silly operating system!) No coding is necessary, except the usual changes you would make to customize your LocalSettings.php file. There are more steps involved than Method 1, but it's relatively easy to do.
History: Method 1 is my newest solution; Method 2 is my original solution.

What this does

This will accomplish exactly the scenario described above. When you're done, for each wiki you'll have:

For Method 1:

  • a secondary LocalSettings.php file for each wiki.

For Method 2:

  • a separate LocalSettings.php file for each wiki (Alternative: You might be able to run the system using a custom LocalSettings.php like I am now doing using Method 1.)
  • a separate images directory for each wiki (Why? Necessary so that each wiki has its own library of images. If you want your wikis to share the same library of images, not needed.)
  • a separate "virtual" directory for each wiki (Why? This is necessary so that, when the user clicks links within your wiki, they will be taken to the correct index.php for each wiki.)

Environment

I did this using the following configuration:

For Method 1:

  • MediaWiki 1.12
  • Shared hosting server running Apache 1.3.33
  • PHP 5

For Method 2:

  • MediaWiki 1.5.1
  • Shared hosting server running Apache 1.3.34
  • PHP 4

Instructions

Method 1

Here are the instructions for Method 1. This is my new creation as of April 18, 2008. It works differently from Method 2, but the two methods could be combined to make the Most Ultimate Wiki in the World :-)

Method 2

Here are the instructions for Method 2. This is the original, world-famous method.

Other MediaWiki Tips and Tricks

Here are other miscellaneous modifications that I've made: WikiHelp - Other Tips and Tricks

Tags

To help folks find this info:

separate mediawiki instance on the same server, media wiki, two wikis, multiple instances mediawiki server source

Steve's Other Websites

StatementConverter.com Convert/import bank account and credit card statements into QuickBooks
InterestRateAlerts.com Get free alerts when home mortgage interest rates change
SVRentals.com Properties for rent in Silicon Valley, California
SteveRumberg.com Steve Rumberg real estate broker (buy/sell, loans and property management)
Personal tools