Page MenuHomePhabricator

01_virtualhost_wiki_farm

Authored By
bzimport
Nov 21 2014, 9:01 PM
Size
6 KB
Referenced Files
None
Subscribers
None

01_virtualhost_wiki_farm

--- mediawiki-1.5.5/config/index.php 2006-01-07 12:15:50.000000000 +0000
+++ mediawiki-1.5.5.orig/config/index.php 2005-10-28 10:02:36.000000000 +0100
@@ -132,31 +132,15 @@
/* Check for existing configurations and bug out! */
-# Enable SetEnv override of LocalSettings.php name: virtual Wikis!
-# in Apache, you can SetEnv MEDIAWIKI mywiki and have different
-# LocalSettings.php for each named site
-$wgSiteName = getenv("MEDIAWIKI");
-if ( $wgSiteName ) {
- $wgLocalSettings = "$wgSiteName.LocalSettings.php";
-} else {
- $wgLocalSettings = "LocalSettings.php";
-}
-
-# Fail safely if SetEnv is invalid...
-if( !file_exists( "../$wgLocalSettings" ) && file_exists( "../LocalSettings.php" ) ) {
- $wgLocalSettings = 'LocalSettings.php';
-}
-
-
-if( file_exists( "../$wgLocalSettings" ) ) {
+if( file_exists( "../LocalSettings.php" ) ) {
dieout( "<h2>Wiki is configured.</h2>
- <p>Already configured... ($wgLocalSettings) <a href='../index.php'>return to the wiki</a>.</p>
+ <p>Already configured... <a href='../index.php'>return to the wiki</a>.</p>
<p>(You should probably remove this directory for added security.)</p>" );
}
-if( file_exists( "./$wgLocalSettings" ) ) {
+if( file_exists( "./LocalSettings.php" ) ) {
writeSuccessMessage();
dieout( '' );
@@ -207,7 +191,6 @@
install_version_checks();
print "<li>PHP " . phpversion() . ": ok</li>\n";
-print "<li>Local Settings: $wgLocalSettings</li>\n";
if( ini_get( "register_globals" ) ) {
?>
@@ -277,7 +260,7 @@
$conf->prettyURLs = false;
break;
default:
- print "unknown; using pretty URLs (<tt>index.php/Page_Title</tt>), if you have trouble change this in <tt>$wgLocalSettings</tt>";
+ print "unknown; using pretty URLs (<tt>index.php/Page_Title</tt>), if you have trouble change this in <tt>LocalSettings.php</tt>";
}
print "</li>\n";
@@ -691,7 +674,7 @@
}
/* Write out the config file now that all is well */
- print "<p>Creating $wgLocalSettings...</p>\n\n";
+ print "<p>Creating LocalSettings.php...</p>\n\n";
$localSettings = "<" . "?php$endl$local$endl?" . ">";
// Fix up a common line-ending problem (due to CVS on Windows)
$localSettings = str_replace( "\r\n", "\n", $localSettings );
@@ -701,10 +684,10 @@
} else {
$xt = "wt"; # 'x' is not available prior to PHP 4.3.2. We did check above, but race conditions blah blah
}
- $f = fopen( $wgLocalSettings, $xt );
+ $f = fopen( "LocalSettings.php", $xt );
if( $f == false ) {
- dieout( "<p>Couldn't write out $wgLocalSettings. Check that the directory permissions are correct and that there isn't already a file of that name here...</p>\n" .
+ dieout( "<p>Couldn't write out LocalSettings.php. Check that the directory permissions are correct and that there isn't already a file of that name here...</p>\n" .
"<p>Here's the file that would have been written, try to paste it into place manually:</p>\n" .
"<pre>\n" . htmlspecialchars( $localSettings ) . "</pre>\n" );
}
@@ -713,7 +696,7 @@
writeSuccessMessage();
} else {
fclose( $f );
- die("<p class='error'>An error occured while writing the config/$wgLocalSettings file. Check user rights and disk space then try again.</p>\n");
+ die("<p class='error'>An error occured while writing the config/LocalSettings.php file. Check user rights and disk space then try again.</p>\n");
}
@@ -976,7 +959,7 @@
<p>Avoid exotic characters; something like <tt>mw_</tt> is good.</p>
</dt>
-
+
<dd><label class="column">Database charset</label>
<div>Select one:</div>
<ul class="plain">
@@ -1018,24 +1001,24 @@
/* -------------------------------------------------------------------------------------- */
function writeSuccessMessage() {
- global $conf, $wgLocalSettings;
+ global $conf;
if ( ini_get( 'safe_mode' ) && !ini_get( 'open_basedir' ) ) {
echo <<<EOT
<p>Installation successful!</p>
<p>To complete the installation, please do the following:
<ol>
- <li>Download config/$wgLocalSettings with your FTP client or file manager</li>
+ <li>Download config/LocalSettings.php with your FTP client or file manager</li>
<li>Upload it to the parent directory</li>
- <li>Delete config/$wgLocalSettings</li>
+ <li>Delete config/LocalSettings.php</li>
<li>Start using <a href='../index.php'>your wiki</a>!
</ol>
-<p>If you are in a shared hosting environment, do <strong>not</strong> just move $wgLocalSettings
-remotely. $wgLocalSettings is currently owned by the user your webserver is running under,
+<p>If you are in a shared hosting environment, do <strong>not</strong> just move LocalSettings.php
+remotely. LocalSettings.php is currently owned by the user your webserver is running under,
which means that anyone on the same server can read your database password! Downloading
it and uploading it again will hopefully change the ownership to a user ID specific to you.</p>
EOT;
} else {
- echo "<p>Installation successful! Move the config/$wgLocalSettings file into the parent directory, then follow
+ echo "<p>Installation successful! Move the config/LocalSettings.php file into the parent directory, then follow
<a href='../index.php'>this link</a> to your wiki.</p>\n";
}
}
@@ -1126,7 +1109,6 @@
$sep = (DIRECTORY_SEPARATOR == "\\") ? ";" : ":";
$localsettings = "
-# $wgLocalSettings
# This file was automatically generated by the MediaWiki installer.
# If you make manual changes, please keep track in case you need to
# recreate them later.
Only in mediawiki-1.5.5: debian
diff -ur mediawiki-1.5.5/index.php mediawiki-1.5.5.orig/index.php
--- mediawiki-1.5.5/index.php 2006-01-07 12:15:40.000000000 +0000
+++ mediawiki-1.5.5.orig/index.php 2005-11-16 21:29:24.000000000 +0000
@@ -16,22 +16,7 @@
define( 'MEDIAWIKI', true );
require_once( './includes/Defines.php' );
-# Enable SetEnv override of LocalSettings.php name: virtual Wikis!
-# in Apache, you can SetEnv MEDIAWIKI mywiki and have different
-# LocalSettings.php for each named site
-$wgSiteName = getenv("MEDIAWIKI");
-if ( $wgSiteName ) {
- $wgLocalSettings = "./$wgSiteName.LocalSettings.php";
-} else {
- $wgLocalSettings = "./LocalSettings.php";
-}
-
-# Fail safely if SetEnv is invalid...
-if( !file_exists( $wgLocalSettings ) && file_exists( './LocalSettings.php') ) {
- $wgLocalSettings = './LocalSettings.php';
-}
-
-if( !file_exists( $wgLocalSettings ) ) {
+if( !file_exists( 'LocalSettings.php' ) ) {
$IP = "." ;
require_once( 'includes/DefaultSettings.php' ); # used for printing the version
?>
@@ -64,9 +49,6 @@
echo( "To complete the installation, move <tt>config/LocalSettings.php</tt> to the parent directory." );
} else {
echo( "You'll have to <a href='config/index.php' title='setup'>set the wiki up</a> first!" );
- if ( $wgSiteName ) {
- echo( "<br>\nLocal Settings: $wgLocalSettings ($wgSiteName)<br>\n" );
- }
}
?>
@@ -77,7 +59,7 @@
die();
}
-require_once( $wgLocalSettings );
+require_once( './LocalSettings.php' );
require_once( 'includes/Setup.php' );
wfProfileIn( 'main-misc-setup' );

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2138
Default Alt Text
01_virtualhost_wiki_farm (6 KB)

Event Timeline