Manual talk:Wiki family

I'm the only author of the text, copied it from m:Help:Wiki family and hereby released it in the public domain... feel free to correct my English, if you find typos, weird wordings ;-) or syntax errors - everywhere … have fun, --Produnis 21:19, 20 April 2006 (UTC)

Install more than one wiki on the same server using one copy of MediaWiki
It is possible to install more than one wiki on a server provided that:

OR
 * You use a different database for each wiki
 * You use a different database prefix for each wiki (for Postgres, you can achieve a similar effect by using different schemas)

The goal is to share the same copy of the MediaWiki for all wikis, instead of duplicate it over and over. Here is what I did under Linux:

MyNewWiki=...

mkdir $MyNewWiki cd $MyNewWiki lndir ../mediawiki-1.9.3

rm LocalSettings.php

Then run the config script again to recreate LocalSettings.php file. Be sure to pick a new database, or give a different prefix from the first Wiki.

Finially, point the browser to the newly created, different wiki.

It seems to be running ok. However, maintenance/importTextFile.php will break (I'm looking into how to solved that right now. In the meantime, if you know the answer, please update):

A copy of your installation's LocalSettings.php must exist in the source directory.

Scenario 2 does not work
If you set up all wikis like said, you have multiple sources. If you delete the sources but of one wiki, the other wikis do not work. You may edit the wiki2LocalSettings.php to match the correct path of the sources ($wgScriptPath), but then edit in wiki2 will edit the main wiki!

Share media files and keep language descriptions
Is it possible to share image and media files in a common directory as described, but retain different language descriptions of the files (i.e. unique Image: and Media: pages), for each project in the family?

It doesn't specifically say so in this tutorial. I want our wiki to keep uploaded files to one place, but allow different image page descriptions for each wiki, AND still keep the same file revision history on each image page.

In other words, can an image used in one of the wikis link to a unique image page for this particular wiki, yet still utilize/share a common, shared file upload and file revision history? --Morten Blaabjerg 23:03, 29 April 2006 (UTC)

LocalSettings / AdminSettings
Description on how to best use common configuration files with small "exception" files per-installation would be useful. -- Sysy / (talk) 22:07, 9 May 2006 (UTC)

Image description
Question: I used the above method to fetch description from Commons, but it fetches the entire page, not just the "#Content" section; I get the action tabs, the left hand nav/tool panels, the style sheet, etc, and it looks realy horrible because it sticks all that inside the #Content section of the wiki I'm fetching from. Is this a bug, or did I do something wrong?
 * Hmmm... i don't know.. In my installed version, it all works fine that way... Maybe you miss-spelled the URL to Pool-Wikis images? --Produnis 16:50, 14 May 2006 (UTC)

Additional Wiki on same server
On a LINUX box I:
 * created a fresh copy of the wiki files in a second directory
 * ran the config script again then moved the newly created LocalSettings.php file
 * was finished!

Note that I did NOT require an additional mySQL database. I DID create additional tables in the existing database. And I just gave those a different prefix from the first Wiki. And to address it, I have to point the browser to a different place inside my website.

Mark --24.195.14.18 03:09, 12 July 2006 (UTC)

So, it is not necessary to make an additional mySQL database, if you wish more than one Wiki in same hosting account. It´s optional. Read Help:FAQ

Shared image repository between different databases on different servers
Hi,

Im hosting my wikis with godaddy at the moment (i know its not the best host) using their economy plan.

I can create databases but every one is at a different url with different database name and database login.

Is there anyway to get the images and image description from the database on another server.

Cheers --158.125.9.4 16:16, 6 December 2006 (UTC)

Scenario 3: Thumbnail issue
Hi,

I followed scenario 3 for my multi-language wikis. At the moment, I've an english and a french wiki. All images go in the english one.

Everything works fine except when I try to create a thumbnail image from the french wiki:

I get the following error: Warning: mkdir [function.mkdir]: $WIKI_HOME/fr/includes/GlobalFunctions.php on line 1534 Warning: imagecreatefromjpeg(/ecwiki/en/images/6/65/RnD_Geo_UseCase_MBorne.JPG) [function.imagecreatefromjpeg]: failed to open stream: No such file or directory in $WIKI_HOME/ecwiki/fr/includes/Image.php on line 1266 Warning: imagecopyresampled: supplied argument is not a valid Image resource in $WIKI_HOME/fr/includes/Image.php on line 1274 Warning: imagejpeg [function.imagejpeg]: Unable to open '/ecwiki/en/images/thumb/6/65/RnD_Geo_UseCase_MBorne.JPG/180px-RnD_Geo_UseCase_MBorne.JPG' for writing in $WIKI_HOME/fr/includes/Image.php on line 1310 Warning: imagedestroy: supplied argument is not a valid Image resource in $WIKI_HOME/fr/includes/Image.php on line 1277

NB: The same operation from the english wiki works fine.

Thanks in advance for your help...

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

Aren't instructions one and two the basically the same?
 * 1) Install MediaWiki and additional tools as usual
 * 2) Set up your wiki (e.g., MyWiki)

So if I get this correctly http://www.foo.com/bubbawiki/ LocalSettings.php would go into "bubbawiki" if "bubbawiki" is where the wiki is installed. It is currently there (where I was told to put it in the set up of the wiki). Is the location different than the standard set up?
 * 1) 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)

I thought the point was to use the "same source code"? I am creating new Mediawiki installs?
 * 1) Repeat the steps above for each wiki you wish to create, with suitable local setting files (e.g., anotherWikiLocalSettings.php, etc.)

Where does this LocalSettings.php file go?
 * 1) 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:

Where does the snip-it code go?

I am sorry to come across so naive on this. But setting up a wiki farm would be great for what we are trying to do. I have been unsuccessful so far with these instructions and I am not PHP programming savant. Thanks!

The "no extra files" solution
My solution requires not one additional file, and merely two symlinks.

I just symlink

radioscanningtw.jidanni.org -> mediawiki-1.10.0 taizhongbus.jidanni.org -> mediawiki-1.10.0

and in mediawiki-1.10.0/LocalSettings.php have this critical fork:

foreach(array('radioscanningtw','taizhongbus') as $v){ if(strpos($_SERVER['SCRIPT_FILENAME'].$_SERVER['PWD'],$v)){ $wgDBname=$wgSitename=$v; $wgLogo="/$v.png"; break;}} $wgScriptPath="";

However I don't have any uploaded images etc. So I didn't test that. Jidanni 00:21, 4 June 2007 (UTC)

Scenario 4 - Common Skins and Extensions
If you want to share common skins and extension code so as to avoid duplication, you can simply do the following in each language's LocalSettings.php file:

$sharedSourceDirectory = '/Path/to/root/of/yourwikipool'; $sharedSourcePath     = 'http://pool.yourwiki.org'; ... $wgStylePath          = "$sharedSourcePath/skins"; $wgStyleDirectory     = "$sharedSourceDirectory/skins"; ... $wgSharedUploadPath     = "$sharedSourcePath/images"; $wgSharedUploadDirectory = "$sharedSourceDirectory/images/"; $wgUploadNavigationUrl  = "$sharedSourcePath/index.php/Special:Upload"; ... $wgRepositoryBaseUrl    = "$sharedSourcePath/index.php/Image:"; ... require_once( "$sharedSourceDirectory/extensions/ExtensionName/ExtensionName.php" ); ...
 * 1) This is the server's local file path
 * 1) This is the URL to the pool wiki
 * 1) For each extension named "ExtensionName" add one of these:

Redundancy and confustion
Hi. This is a great article and very helpful, but some parts of it seem redundant or just unclear. For context, I program php full time.


 * 1) "Scenario 1" doesn't seem to be a different scenario from 2 and 3, but just a link to a 3rd party recipe.
 * 2) It's not clear at all what the difference is between the two code examples in Scenario 2. It seems like all cases of the second one would work in the first one, and also the non-domain parts of the logic are different, and it's not clear if that's a result of the history of this document, or if the examples are actually trying to illustrate different logic.
 * 3) The introduction to Scenario 3 does not mention in any way, shape, or form, how it differs from Scenario 2, other than that it is "Drupal style". I don't know what that means. In fact, the introduction essentially states that it is exactly the same as Scenario 2.

If I was a better mediawiki hacker I'd try to fix this myself, but I thought I'd just throw in some feedback in case any mediawiki pros out there want to spiff up this document.

Thanks! John

Scenario2 and shared privacy-, disclaimer- and copyright-pages
We use Scenario2 with one installation and multiple configs and databases. Everything works fine, but we want to have only one privacy-, disclaimer- and copyright-page for all (sub)wikis together. does anybody know if there is something like

$wgRightsUrl ...

for the disclaimer- and the privacy-page? -- Jens 09.11.2007

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

Same question as above: Aren't instructions one and two the basically the same?
 * 1) Install MediaWiki and additional tools as usual
 * 2) Set up your wiki (e.g., MyWiki)

Done, now I have something like Serverside: www/MyWiki With: www/MyWiki/config/LocalSettings.php


 * 1) 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)

Done, now I have something like Serverside: www/MyWiki/MyWikiLocalSettings.php

Same question as above: I thought the point was to use the "same source code"? I am creating new Mediawiki installs?
 * 1) Repeat the steps above for each wiki you wish to create, with suitable local setting files (e.g., anotherWikiLocalSettings.php, etc.)

Done, now I have something like Serverside: www/MyWiki/MyWikiLocalSettings.php And Serverside: www/MyWiki/SecondMyWikiLocalSettings.php Serverside: www/MyWiki/ThirdMyWikiLocalSettings.php

I have also Serverside: www/MyWiki Serverside: www/SecondMyWiki Serverside: www/ThirdMyWiki with the complete code inside of each. Have I missed the "delete some files" part?


 * 1) Create a LocalSettings.php file for your global settings, then select one from the two possibilities below:

Done. Now I have a file named LocalSettings.php and inside I have

Now I put this into my "BaseWiki" e.g. MyWiki Serverside: www/MyWiki/LocalSettings.php

Each Wiki is working as “stand alone”. I have tried this with Xampp

hxttp://localhost/www/Mywiki/index.php & hxttp://localhost/www/SecondMyWiki/index.php

are bringing up the startpage. But after renaming and moving the LocalSettings to the MyWiki file and creating the new LocalSettings I see only

Error, Setup.php must be included from the file scope, after DefaultSettings.php

Any help is appreciated.. but please remember the poor people who rend a hostingpakage and not a whole server. I have to work with (Fire)FTP and phpmyadmin

same error, not working
I followed scenario two, not working too, i get the same error when trying to open wiki root wiki/...and 404 when adding the specified uri, en for example..i wanted to note that you don't install more wikis, just one wiki source..when you rename your generated localsettings.php, you can install mediawiki again with different settings and create another settings file (which you rename and continue to make another)..when you finish, you just create the global LocalSettings.php which have the ettins the method mentions which is not working for me..but may be that is because i use lighttpd though i doubt it..--Alnokta 14:34, 26 December 2007 (UTC)

Problem with Upload
$wgUploadNavigationUrl = "http://www.mywiki.org/wiki/index.php/Special:Upload"; won't work if I set this value in a german wiki (de/) which should use the mainwiki's (wiki/) Upload folder. don't want to have to different image/ folders but all in the same wiki/image/. Spezial:Upload in the german wiki will lead on upload to a write error: The upload directory (public) is not writable by the webserver. Of course, since I did not give write permission on de/image/ but this proves that the german uploaddirectory is still being used, despite the config. 86.39.64.5 13:19, 2 March 2008 (UTC)

Database error

 * A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:

(SQL query hidden)

from within function "MediaWikiBagOStuff::_doquery". MySQL returned error "1205: Lock wait timeout exceeded; try restarting transaction (localhost)".

Easiest way
The easiest and imho the best way to do this (and has been for several years) :
 * Create a unique domain name or subdomain for each wiki
 * Create a database for each wiki
 * Install one copy of Mediawiki and extensions (and probably a seperate copy purely to be used for running maintenance scripts) and point all subdomains to this folder in Apache
 * Optionally share an uploads area
 * Share the user database between wikis, using either the Mediawiki setting or by creating a SQL View
 * Use the conditional logic provided overleaf to alter the settings for each wiki based on which wiki is being accessed

It really is that simple and works a treat.

I don't know if it's possible on Windows because I don't know if IIS can serve multiple named hostnames from one folder, but I imagine it can. If not, it is at the very least possible to share common settings on Windows by using a require_once directive to read in the common settings. --Kingboyk 12:41, 15 June 2008 (UTC)

Scenario 4: no thumbnails?
I've shared uploads and descriptions and all that detailed in scenario 4. I made the permissions on the /images directory in the repository all 777. However, when I use the following code I get an error instead of a thumbnail. ends up like: Error creating thumbnail: Unable to create destination directory It seems like it's permissions-related. Any ideas?

Drupal Scenario doesn't not work
The drupal scenario looks rather clever, clean and flexible. My installation with several wikis now looks very clean and easy to understand and administrate. However, I get "Forbidden - You don't have permission to access / on this server." or "Forbidden - You do not have permission to access this document." when I try to access the new wikis after having followed closely the Drupal Scenario.

Here are things that I have tried out, which did however *not* solve the problem:
 * the setup has a versioned mediawiki directory with the actual code (a), a softlink to it named code (b) and a directory (c) for the actual wiki(s) with softlink to b. As this did not work, I thought that this may be due to the too many (3) stages, so I tried to reduce these stages to 2 or one by directly softlink from c to a or to directly mention the (a) or (b) directory as virtual directories of the wiki domain in the apache config. All did not work (and of course I restarted apache2 all the time).
 * I also tried to make sure that the user rights of the directories and softlinks were appropriate, again this did not help.
 * As I thought that may be the problem lies in the flexible LocalSettings.php, I tried to just call a simple html-file or the README file to make sure that the problem was not related to php and php code. but I even got the rights problems when calling such non-php code (Even connected to simple setups like the one mentioned above).
 * I should add that I tested the above scenario with latest Debian4, php 5.2, apache 2.2.

Has anyone ever tested it successfuly? The phrase "*should* now work" may indicate that this was not tested 1:1. So what is needed is more details in the explenation: what are the user and group rights/settings for each directory and link, how do you set up excactly the apache settings both for the mediawiki code directory, the mediawiki version directory and the actual wiki directory (Which is softlinkes/redirected to code which itself is again softlinked to the mediawiki version) etc...

Also, now the numbering of the scenarios has gone wrong, it seems we now have 2 (two!) scenarios both named "scenario 3", one of them being the Drupal Scenario.

Kai 91.62.106.57 22:16, 20 August 2008 (UTC)

Update (22 August 2008): These improvements helped: I was able to access the README files of teh wiki sites form the browser. I even was able to see the index.php.
 * the mediawiki, mediawiki/code and mediawiki/ directories needed to have rights rx for all (owner, group and all). This helped a lot.
 * when I combined this with directly accessing the /mediawiki/code directory in the apache configuration file,

However, I now have a different (less dificult, I hope) problem: I now see the setup page of the wiki. This should not display as I have a proper LocalSettings.php in my code/ directory copied from http://www.mediawiki.org/wiki/Drupal-style_LocalSettings.php )and changed the $confdir variable at the start of the file to point to my mediawiki directory) and I also have a LocalSettings.php in each /mediawiki/sites/ directory.

From debugging the code, it seems that the code from http://www.mediawiki.org/wiki/Drupal-style_LocalSettings.php is *NOT* able to locate the correct file from mediawiki/sites/ /LocalSettings.php (where I use domain without www prefix and without port or directory, just simple e.g. en.mywiki.org or similar domain names). I tried both versions in the history of that file, one with for loop and one with while loop, but both end with no $conf variable set and so end with the setup dialogue from /includes/templates/NoLocalSettings.php

What finaly helped was to set safe_mode_gid=On (I have safe_mode=On), as the file_exist function otherwise returned false. Now it seems to work...

"Drupal-style" means what, exactly?
Can this section be retitled/rewritten to make sense for everybody that hasn't used Drupal before? This name is given as if it is self-explanatory, but it is not. ⇔ ChristTrekker 04:27, 13 November 2008 (UTC)