Install a MediaWiki codebase

From Organic Design wiki
Revision as of 02:02, 2 June 2008 by Nad (talk | contribs)
Procedure.svg Install a MediaWiki codebase
Organic Design procedure

This article describes installing a new version of the MediaWiki software itself. This is a framework which can be thought of as a class which provides the interface structure and database schema for any instances of the software which are separate evolving databases. This process is also useful for creating a duplicate of an existing codebase for experimentation.

File structure

<bash>
  1. Installed versions

/var/www/mediawiki-1.6.7/ /var/www/mediawiki-1.9.3/ /var/www/mediawiki-1.10.0/ /var/www/mediawiki-1.11.0/

  1. Example of template filesystem Symbolic link to common MediaWiki instance

/var/www/wikis/template/wiki -> /var/www/mediawiki-1.10.0/ </bash>

Codebase hacks

  1. Download MediaWiki to the server you want to install it on
  2. Change the constants in Article.php functions getBlankingAutosummary, getAutosummary and the end of delete to $GLOBALS['wgTruncatedCommentLength'] (11543)

Installation steps

  1. Unpack the tar.gz distribution into /var/www leaving the directory name of the version untouched. The config directory must be set to chmod a+w config
  2. Set the /var/www/domains/setup.organicdesign.co.nz symlink to point to the new codebase
  3. A symlink needs to be added in the codebase during initial setup called wiki which points to it's parent, the codebase dir e.g. ln -s /var/www/mediawiki-1.11.1/ wiki
  4. Go to http://setup.organicdesign.co.nz/wiki/config in your browser and run through the install the db user bender, and any template db name. Use your own account for sysop rather than "WikiSysop".
  5. Move the config/LocalSettings.php into the main /wiki directory
  6. edit the LocalSettings.php, remove any site-specific settings
  7. Replace the extensions directory with a symlink to /var/www/extensions
  8. Move the created LocalSettings file from /wiki/config into /wiki and append include('extensions/wikia.php');
  9. Run make in the wiki/math directory
  10. Add the DPL DB update shown at DPL:DPL:Manual - Source and Installation (after we figure out why it's not working!)
  11. Create a template database (either copy and upgrade an existing template, or add to the base install)
mysqldump -u user --password='*******' db-name > /var/www/empty-x.xx.sql
Note: see section below for DB user details
  1. Not sure if this is still relavent, but the template-db's may need a column added for DPL, see OD:01 May 2007

MediaWiki MySQL user

Mediawiki is setup with the mysql user account Bender with the password specified as in MW:LocalSettings.php through the include of Wikia.php. User Bender has privileges to create and access all the wikia databases.

BASH commands

This is currently an overview of the process. <bash> version=1.11.0 documentroot=/var/www

mirror=http://download.wikimedia.org/mediawiki/1.11/

  1. 1) Download MediaWiki

cd $documentroot if [ ! -e mediawiki-${version}.tar.gz ] then

 wget --proxy ${mirror}/mediawiki-${version}.tar.gz

fi

  1. 2) Unpack and remove

tar -zxvf mediawiki-${version}.tar.gz rm mediawiki-${version}.tar.gz cd $documentroot/mediawiki-${version} chmod a+w config

  1. 3) Remove extensions directory and create symbolic link

rm -rf extensions ln -s /var/www/extensions extensions

  1. 4) Follow the configuration instructions on the wikipage $domain/${wikidir}

cat <<EOF ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. Now its time to configure your MediaWiki installation at: ${htdocs}/${wikidir} Using a web browser, follow the instructions at: http://$domain/${wikidir} When you have finished type: y ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. EOF finished=N while [ $finished != "y" ] do

   echo "Press 'y' when you have configured MediaWiki"
   read finished

done

  1. 5) Move default LocalSettings.php from /wiki/config into /wiki

cd ${htdocs}/mediawiki-${version} mv ./config/LocalSettings.php . echo "include('extensions/wikia.php');" >> LocalSettings.php chmod 600 ${htdocs}/${wikidir}/config </bash>

See also