WikiHelp
From MyCambrian
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.phpfile, like this:index.php?w=SomeCode
- To implement this, you modify the
LocalSettings.phpfile. Cookies must be enabled. Very easy.
- To implement this, you modify the
- 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.phpfile. There are more steps involved than Method 1, but it's relatively easy to do.
- 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
- 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 with over 13,000 page views!
Other MediaWiki Tips and Tricks
Here are other miscellaneous modifications that I've made: WikiHelp - Other Tips and Tricks
Bonus Tip
How would you feel if your hours and hours of programming was lost? What if your computer and backup were stolen? Do you forget to backup? Are you certain your backup is actually saving your important files? Do you have to remove some files from the backup set in order to make space for other files? Or, you don't backup at all (yikes!)?
I use this fantastic online backup service and I love it so much that I am a raving fan! The system backs up your files in real time, as they change, so there's no forgetting or "I'll do it later." Your files are saved encrypted to an offsite server, so your data is safe even if your computer and backup device are stolen or lost in a fire (which, of course, would also destroy your precious onsite backup).
And, get this: It displays a green or yellow dot next to each file on your computer so that you know instantly whether your files have been backed up or not-- too cool! The system works in the background, so your computer continues to run full-speed. And, recovering a file from the server is simple, too-- just 3 clicks, select your file and it is promptly restored to your computer! Perfect!
You know you should backup your files, but it takes time, the cost is annoying, the fee increases as the size of your data increases, or you're unsure how to do it. No more! Get the Carbonite service-- it is easy (6 clicks to install), requires nothing but an Internet connection, and includes UNLIMITED backup!
It's only US$5/month with no commitment or just US$4.17/month for one-year subscription and clicking this link gets you a 15-day free trial with no credit card required: Carbonite backup


