On Monday 15 November 2004 11:16, Tim Starling wrote:
Perhaps you would like to tell us what you actually
intend to do?
The ideal, for me, would be that a single SIMPLE index.php
dropped into any on-web doc root pulls up a unique full working
instance of MediaWiki. That 99.9% of the code works properly
from an off-web includes area and, but not so importantly, that
on-web CSS and image requirements can come from some default
initial domain so that nothing other than the index.php and a
LocalSettings.php are required in any vhost webfolder...
<?php
require './LocalSettings.php';
require 'mediawiki.php';
?>
I understand it might be obscure from the outside, but
our apache
configuration files have been publically available for some time. I just
uploaded the remainder of our wiki configuration, and made an index file:
http://wikimedia.org/conf/
Good one, that backs up the textual explanation nicely.
I can't see any problems scaling up our
configuration from 500 to 4000
subdomains. What problems have you encountered?
None yet. I can easily hack the code to make it work for our
particular system setup close to my ideal spec above, but,
that makes future upgrades a risky process. The current install
basically assumes that all the required parts are within the
same directory as the index.php. The simplistic approach to
creating a second installation, on the same server, would be to
repeat the current installation procedure and create a separate
completely independant installation in another webfolder. That's
fine up to about a dozen installs and then it gets out of hand
in both the installation procedure and any future upgrades.
With my first attempt to make MediaWiki work, like my specified
"ideal" above, it seemed to me that it _MAY_ not take much effort
to mildly alter the front end controller and installation procedure
to take into account either a simple single installation OR a more
complex multi-hosting installation. If so, and it became an official
core part of the MediaWiki project, then there would be no reason
not to use MediaWiki in larger multi-hosted environments. It can
be now with some tinkering but I can see that even that tinkering
could be absorbed into an official installation procedure.
My first attempt was to create a default installation then move
everything inside an offweb include path and start with a simple
<?php include 'mediawiki.php' ?> (being the current index.php)
and put back into the current webfolder what was essential to
bring up any page at all. The simplest minimum, without worrying
about a default webhost for images and stylesheets, is...
LocalSettings.php
images/
index.php
redirect.php@ (a link -> index.php)
stylesheets/
tmp/ (was autocreated)
I changed $IP in LocalSettings.php to the off-web include dir and
commented out the initial part of mediawiki.php (original index.php)
to just below the "require LocalSettings.php" and now my current
index.php used above is...
<?php
error_log(var_export($_REQUEST, true));
$wgRequestTime = microtime();
unset( $IP );
@ini_set( "allow_url_fopen", 0 ); # For security...
if(!file_exists("LocalSettings.php")) {
die( "You'll have to <a href='config/index.php'>set the
wiki up</a> first!" );
}
define( "MEDIAWIKI", true );
require_once( "./LocalSettings.php" );
if (isset($_GET['redirect']) and $_GET['redirect'] == 'Go') {
# unset( $DP );
# unset( $IP );
$wgCommandLineMode = false;
# require_once( "./LocalSettings.php" );
global $wgArticlePath;
require_once( "WebRequest.php" );
$wgRequest = new WebRequest();
$page = $wgRequest->getVal( "wpDropdown" );
$url = str_replace( "$1", urlencode( $page ), $wgArticlePath );
header( "Location: {$url}" );
} else {
include 'mediawiki.php';
}
?>
This is my first cut at it in the first hour of installing MediaWiki
to see what might be involved in doing this. It's in no way working
properly or anywhere near deployed. I was pleased that I did not have
to alter too much code to get to this point and it occurred to me
that it might be possible to continue this move through "official
channels" to get something like this into the core code.
--markc