You may run into issues with the databases though. When you upload an image you also add a database entry to the image database table. If you are sharing images with some odd method you should also share the database. That would involve hacking inclues/Database.php with a method I am very familiar with to tell it to use a different database when dealing with that table.
But it's not possible to make image information pages shared between the two wiki. So it would probably be best to use the commons method. That method uses an image fallback, and also uses image pages from that commons wiki when it's using the fallback images. It's also tested and used on the WikiMedia projects so it's reliably safe to use in comparison to a random method of sharing.
~Daniel Friesen(Dantman) of The Gaiapedia, Wikia Graphical Entertainment Project, and Wiki-Tools.com
Agon S. Buchholz wrote:
Hi,
I'm currently exploring the file storage of MediaWiki which left me for several hours in pure amazement, when I realized, that *several wikis* can share the same files even *without* enabling $wgUseSharedUploads.
Now I'm trying to figure out if this is safe (most probably it isn't, why else would $wgUseSharedUploads have been invented?). Anyway I'd love to hear comments from people who have tried similiar stuff!
Starting point:
- Two wikis with apparently different topics (canids, photography),
separate domains, separate codebase, separate image storage. At first I thought, the topics would be completely different, later I found myself and others increasingly often replicating images & descriptions between those two wikis (e.g. images of canids used at the photography wiki to display characteristics of several lenses, and vice versa). Thus I started to experiment with shared storage, firstly according to [1] ("Scenario 4: Multiple wikis sharing common resources"), later trying to avoid a separate image "pool".
Setup:
Image storage: /var/mw_shared
MediaWiki sites: /var/www/site1, /var/www/site2
LocalSettings.php: $wgUploadDirectory = "/var/mw_shared";
Apache2 (for site1; site2 similar):
** Alias /wiki "/var/www/site1/w/index.php" ** Alias /index.php "/var/www/site1/w/index.php" ** Alias /w/images "/var/mw_shared"
Preliminary result:
- This extremly simple setup gives me (a) short URLs and (b) and a
shared file storage for both sites. The Alias "/w/images" takes care that image locations point to a path outside the website's root, and $wgUploadDirectory from both wikis points to /var/mw_shared, images can be used in both wikis with the usual syntax [[image:file.ext]].
- At the moment this seems to work, and I haven't yet run into side
effects. However, I'd like to know if this setup is safe and sane since it appears much too simple to be true.
I'm planning to have both wikis around long term. Even if this setup would continue to work, would it be preferable fall back to the separate image "pool" setup according to [1]?
Thanks & Greetings, -asb
[1] http://www.mediawiki.org/wiki/Manual:Wiki_family
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l