Florent Georges wrote:
Hi,
I did not find any info relative to this topic in the doc. I have two virtual hosts on
a server, accessed by two different domain names. From the outside they look exactly as
two different servers. From the inside, they have two different web homes, two different
SVN home of repositories, etc.
For MediaWiki, I wonder whether it is possible to use the same principle: to have the
software installed only once, and use it from two different virtual hosts (by configuring
two different databases, two different directories for extensions, etc.)
As far as I know, I have instead to install MediaWiki twice. So I cannot use the
package in my OS's packaging system...
Any thought/confirmation on this?
Regards,
Yes you can.
There are several methods outlined at
http://www.mediawiki.org/wiki/Manual:Wiki_family
Basically, you can put in LocalSettings.php
if ($_SERVER['host'] == "domain1.com")
require("LocalSettings_domain1.php");
else if ($_SERVER['host'] == "domain2.com")
require("LocalSettings_domain2.php");
else
die("No such wiki");
And have files LocalSettings_domain1.php and LocalSettings_domain2.php,
each pointing to a different database, different upload folder...
You can also set some options at the main one to share them.
Beware of mediawiki OS packages, though. It's sad to say this, but
generally they don't do a good job with mediawiki.
We recommend to stick with the official version from
mediawiki.org and
be susbscribed to either this list or mediawiki-announcements to keep it
up to date.