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)".