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

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T6505, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 4505 - Need a LocalSettings.php per virtual Wiki site
Need a LocalSettings.php per virtual Wiki site
Status: RESOLVED WORKSFORME
Product: MediaWiki
Classification: Unclassified
Installer (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 4509 (view as bug list)
Depends on:
Blocks:
  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: ---


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

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

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 ) {
  include_once("./$qualifier.LocalSettings.php");
} else {
  include_once("./LocalSettings.php");
}

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,
Jeff
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:
https://wikitech.leuksman.com/view/Wiki_farm
http://meta.wikimedia.org/wiki/MediaWiki_FAQ#How_do_I_create_a_small_wiki_farm.3F

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.

https://wikitech.leuksman.com/view/Wiki_farm - 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.

http://meta.wikimedia.org/wiki/MediaWiki_FAQ#How_do_I_create_a_small_wiki_farm.3F
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
</VirtualHost>

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.

Regards,
Jeff
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.


Navigation
Links