Last modified: 2006-01-07 12:22:41 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 4505 - Need a LocalSettings.php per virtual Wiki site
Need a LocalSettings.php per virtual Wiki site
Product: MediaWiki
Classification: Unclassified
Installer (Other open bugs)
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: 4509 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2006-01-06 17:38 UTC by Jeff Armstrong
Modified: 2006-01-07 12:22 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---

Support VirtualHost Wiki-farm (6.09 KB, patch)
2006-01-07 11:45 UTC, Jeff Armstrong
virtualhost wiki farm - this patch superceeds previous patch (6.88 KB, patch)
2006-01-07 12:22 UTC, Jeff Armstrong

Description Jeff Armstrong 2006-01-06 17:38:47 UTC
I have installed mediawiki in one location on my host (as per Debian

I run Apache2 and want to set up a number of independent Wikis - the virtual
websites are all configured and ready to serve!

index.php includes ./LocalSettings.php - I need an option that makes it include
a LocalSettings.php specific to the Virtual Server that the index.php is being
served under.

As a proposal, if in my Virtual Server section I say:
  SetEnv MEDIAWIKI site1

then I would want index.php to say something like:

$qualifier = getenv('MEDIAWIKI');
if ( $qualifier ) {
} else {

I would then be able to have completely separate virtual mediawikis, with a
single install of the software - separate databases etc etc etc.

Is this possible?

Regards & thanks,
Comment 1 Brion Vibber 2006-01-06 20:49:47 UTC
LocalSettings.php is code. The file autogenerated by the web installer is a simple 
case, but it can be arbitrarily complex. You could keep your per-wiki configuration 
in separate files and include them based on the hostname, or as we do use an array 
of setting overrides based on site and language.

For a little info on our and other possible setups see:

Comment 2 Brion Vibber 2006-01-06 21:47:07 UTC
*** Bug 4509 has been marked as a duplicate of this bug. ***
Comment 3 Jeff Armstrong 2006-01-07 11:42:33 UTC
I understand that the MediaWiki maintainers are probably very busy - but either
of the proposed solutions works very well, and the attached patch fixes the problem. - I have no need to to manage a
wiki farm with some data shared and some not. Nor do I want to create a series
of custom scripts that will require hand-crafted maintenance or at least
testing, when MediaWiki is upgraded and changes. This is not a solution for
best-practice orgs where sysadmin and development are ring-fenced.
main reccommendation does not satisfy the requirement to have the source just
once, with distinct LocalSettings.php. Later suggestions also talk about
hand-crafted creation of symlinks and clones of LocalSettings.php. Again, not a
reliable / quality recommendation.

What is required is a simple distinct wiki-farm mechanism, where a sysadmin can
associate a wiki with a virtual host. Our sysadmins will not hand-craft and
maintain a LocalSettings.php where a stray curly-brace error would cause issues
for all wikis etc. They want simple configuration - as I suggessted, an Apache
one-liner(3 words) in the virtual server, with no risk of changing / introducing
PHP errors for any other wiki.

<VirtualHost *>
  SetEnv MEDIAWIKI alphawiki

The attached patch on bug #4509 for index.php and config/index.php recognises
this environment setting, and solves the problem for everyone, without affecting
existing users. It works for Apache versions 1.2 - 2.2, and any webserver that
can set an environment variable.

Comment 4 Jeff Armstrong 2006-01-07 11:45:42 UTC
Created attachment 1271 [details]
Support VirtualHost Wiki-farm

index.php includes LocalSettings.php depending on environment variable value
Comment 5 Jeff Armstrong 2006-01-07 12:22:41 UTC
Created attachment 1272 [details]
virtualhost wiki farm - this patch superceeds previous patch

Fixes some bugs in previous patch

Note You need to log in before you can comment on or make changes to this bug.