Difference between revisions of "Setup MediaWiki on AWS"

From dftwiki3
Jump to: navigation, search
Line 16: Line 16:
 
* If migrating, copy the extensions, skins, images, media, Downloads directory from old wiki to new installed wiki.
 
* If migrating, copy the extensions, skins, images, media, Downloads directory from old wiki to new installed wiki.
 
* Install one extension at a time in extensions directory, and at the end of LocalSettings.php
 
* Install one extension at a time in extensions directory, and at the end of LocalSettings.php
 +
==Updated Extensions==
 +
I had to update several extensions to match the new format.
 +
<onlydft>
 +
<source lang="php">
 +
<?php
 +
// taken from http://www.mediawiki.org/wiki/Manual:Extensions (DFT)
 +
// Avoid unstubbing $wgParser on setHook() too early on modern (1.12+) MW versions, as per r35980
 +
 +
// To add new ips that are allowed, add them to the array ips in isAllowedIp()
 +
 +
//if ( defined( 'MW_SUPPORTS_PARSERFIRSTCALLINIT' ) ) {
 +
//  $wgHooks['ParserFirstCallInit'][] = 'onlydftSetup';
 +
//} else { // Otherwise do things the old fashioned way
 +
//  $wgExtensionFunctions[] = 'onlydftSetup';
 +
//}
 +
 +
$wgHooks['ParserFirstCallInit'][] = 'OnlyDftExtension::onParserSetup';
 +
 +
class OnlyDftExtension {
 +
      public static function onParserSetup( Parser $parser ) {
 +
      $parser->setHook( 'onlydft', 'OnlyDftExtension::onlyDftRender' );
 +
      }
 +
 +
      public static function onlyDftRender( $input, array $args, Parser $parser, PPFrame $frame ) {
 +
        global $wgUser;
 +
 +
$parser->disableCache();
 +
 +
        $userName = $wgUser->getName();
 +
        $output = $parser->recursiveTagParse( $input, $frame );
 +
        if ( strcmp( strtolower($userName), "thiebaut" ) == 0 ) {
 +
              $output = "<br /><hr />" .  $output . "<br><hr />";
 +
        }
 +
        else {
 +
              $output = "<br /><center><font color=\"orange\">...</font></center><br />\n";
 +
        }
 +
        return $output;
 +
      }
 +
}
 +
 +
</source>
 +
</onlydft>

Revision as of 17:22, 13 January 2018

D. Thiebaut (talk) 16:44, 13 January 2018 (EST)


This page contains very sketchy steps for setting up (in my case moving) an existing mediawiki installation to AWS. This list is mostly for myself to remember what steps I have taken.

Mediawiki Installation/Upgrade

  • Follow the steps from https://www.mediawiki.org/wiki/Manual:Upgrading
  • Download the new mediawiki in a directory belonging to the Web server
  • unzip/untar.
  • Create new MySql user/password/database on localhost (same host as Web server)
  • Verify that base directory of mediawiki installation is accessible from a browser by putting a phpinfo.php file in it and loading it up with browser.
  • use browser and point to /mw-config in the mediawiki web directory. Enter database information.
  • Update the LocalSettings.php file
  • If migrating, copy the extensions, skins, images, media, Downloads directory from old wiki to new installed wiki.
  • Install one extension at a time in extensions directory, and at the end of LocalSettings.php

Updated Extensions

I had to update several extensions to match the new format.


...