Help:MediaWiki

From IKMEmergent

Jump to:navigation, search

Editing Help
Editing
Editing pages
Starting a new page
Formatting
Links
IKME Specific Help
IKMEmergent Categories
WYSIWYG Editor
Adding and Editing Events
Creating Imagemaps
Embedding videos from external sites
Uploading and embedding video via FTP
Left Hand Navigation Menus
Right Hand Navigation Menus
Importing RSS Feeds
Upgrading MediaWiki
Updating the custom skin
Advanced Editing
Images
Tables
Categories
Moving a page
Redirects
Deleting a page

There is a development version Fredericksburg DUI lawyer of this site at https://en.ikmemergent.net.webarch.net/ and the code for the site is hosted in a Subversion repo at https://svn.mkdoc.com/ikmemergent/ both of these site use a free community SSL certificate from CAcert — to aviod the security warnings install the CACert root certificate, to do this for Firefox follow this link.

Contents

Live Server

This site is running on a dedicated virtual server which is maintained by Chris at Webarchitects, chris@webarchitects.co.uk, the install notes and the upgrade notes for erin azar this site Phuket Real estate are hosted on the development version of the site.

Upgrading Mediawiki

To upgrade to a new version of Mediawiki first it needs to be tested on the development server and following are the weight loss pills steps for doing this.

Import a new version of Mediawiki

To ensure that the versions of link building extensions match the proposal software version Carousel Day School of Beauty Schools of America Complaints Mediawiki the mw-vendordrop script has been written, to Susan Lim import the 1.6 branch:

mw-vendordrop REL1_16
  Do you want to tag this commit? (y or return to skip): y
  Manually enter tag (return to tag as REL1_16): 
  Directory /home/chris/mediawiki-code/REL1_16 will be tagged as REL1_16
  Please examine identified tags.  Are they acceptable? (Y/n) y
  Continue printing (Y/n)? y
  ...
  Enter two indexes for each column to rename, (R)elist, or (F)inish: f

After the above has run the Mediawiki REL1_16 code and extensions have been imported into https://svn.webarch.net/ikmemergent/vendor/current/ and it's been tagged as REL1_16

If there are some proposal software updates to the Merchant Services Protection Plan REL1_16 branch that need importing then follow the step above but either tag it as REL1_16_X or don't tag it.

The next step is to merge this code into the trunk:

cd ikmemergent
svn up
svn merge https://svn.webarch.net/ikmemergent/vendor/REL1_16 trunk
 Summary of conflicts:
  Tree conflicts: 1

The tree conflict is because extensions/ConfirmEdit/FancyCaptcha.php has been removed from the trunk because it contains iphone photography server specific path info, so delete this file from vendor/current and vendor/REL1_16 and mark it as resolved and re-run the above command.

svn resolved trunk/extensions/ConfirmEdit/FancyCaptcha.php

And then test it on the dev server, which is running trunk

cd /var/www/ikmemergent.net.webarch.net
svn up
cd maintenance
php update.php

And then run the SMW scripts at https://en.ikmemergent.net.webarch.net/index.php?title=Special:SMWAdmin if need be.

And if everything is OK then tag this version:

cd ikmemergent
svn cp trunk branches/REL1_16

And then update the live server:

...

mw-vendordrop

This script automates importing a version of Mediawiki to https://svn.webarch.net/ikmemergent/vendor/

#!/bin/bash
 
# working directory
MW_CODE=~/mediawiki-code
 
# mediawiki repo
MW_SVN=http://svn.wikimedia.org/svnroot/mediawiki/branches
 
# the place where the vendor branches are to be added / updated
VENDOR_DIR=https://svn.webarch.net/ikmemergent/vendor
 
# location of svn_load_dirs.pl
SVN_LOAD_DIRS=/usr/lib64/subversion/contrib/client-side/svn_load_dirs/svn_load_dirs.pl
 
# where we are
# check for input
if [[ -z $1 ]]; then
  echo "The first argument should be the Mediawiki tag from:"
  echo $MW_SVN 
  echo "The second, optional argument is --force to cause overwriting"
  exit
else
  MW_VERSION=$1
fi
 
# check for -- force as it is needed if we are updating the code from a previously
# exported branch 
if [[ $2 == "--force" ]]; then
  SVN_EXPORT="svn export --force"
else
  SVN_EXPORT="svn export"
fi
 
# check $MW_CODE diretory
if [[ -d $MW_CODE ]]; then
  echo "Using $MW_CODE for copy of exported code"
else
  mkdir $MW_CODE || echo "There was a problem creating $MW_CODE"
fi
 
# change to the directory were the code will be exported to
cd $MW_CODE || echo "There was a problem moving to $MW_CODE"
 
# get the main code
echo "Exporting the code from $MW_SVN/$MW_VERSION/phase3 to $MW_VERSION"
$SVN_EXPORT $MW_SVN/$MW_VERSION/phase3 $MW_VERSION || echo "There was a problem exporting $MW_VERSION "
 
# extensions
cd $MW_VERSION/extensions
 
# get the extensions from the mediawiki repo
for e in googleAnalytics ImageMap Lockdown ParserFunctions SyntaxHighlight_GeSHi \
        ConfirmEdit SpamBlacklist SemanticMediaWiki CategoryTree SemanticDrilldown \
        SemanticForms FramedVideo DynamicPageList FCKeditor
do
  echo "Exporting the code from $MW_SVN/$MW_VERSION/extensions/$e" 
  $SVN_EXPORT $MW_SVN/$MW_VERSION/extensions/$e || echo "There was a problem exporting $e"
done
 
# get the 3rd party code
for x in 'http://idlecrew.de:2380/svn/public/mediawiki-rss/feedimport' \
         'http://semanticgraph.svn.sourceforge.net/svnroot/semanticgraph/trunk/SemanticGraph' \
         'http://mw-extensions.googlecode.com/svn/trunk/websiteFrame'
do
  echo "Exporting the code from $x"
  $SVN_EXPORT $x || echo "There was a problem exporting $x"
done
 
# remove some things we don't want
rm ConfirmEdit/FancyCaptcha.php
 
# these things are got manually:
# http://www.mediawiki.org/w/index.php?title=Extension:Calendar_(Barrylb)/Calendar.php&action=raw
# http://www.mediawiki.org/w/index.php?title=Extension:Calendar_(Barrylb)/SpecialEvents.php&action=raw
# http://jimbojw.com/wiki/index.php?title=ShareThis&action=raw&ctype=text/plain&name=ShareThis.php
 
# do we want to tag this?
printf "Do you want to tag this commit? (y or return to skip): "
read TAG_COMMIT
if [[ "$TAG_COMMIT" = "y" ]]; then
  printf "Manually enter tag (return to tag as $MW_VERSION): "
  read TAG
  if [[ "$TAG" ]]; then
    echo "Tagging as $TAG" 
  else
    TAG=$MW_VERSION
  fi
fi
 
 
# http://svnbook.red-bean.com/en/1.5/svn-book.html#svn.advanced.vendorbr.svn_load_dirs
# commit the branch
if [[ "$TAG" ]]; then
  $SVN_LOAD_DIRS -t $TAG $VENDOR_DIR current $MW_CODE/$MW_VERSION
else
  $SVN_LOAD_DIRS $VENDOR_DIR current $MW_CODE/$MW_VERSION
fi

Original Server

The following notes are based on the original server that was hosting this site — they no longer apply.

MediaWiki has quarterly stable code releases and also sometimes security update between the quarterly code releases, this means that the site really needs to be upgraded at least four times a year. You can see what version of MediaWiki this site is running via the Special:Version page.

Since an upgrade has the potential to result in a site that doesn't work it's essential to first test the updates on a development server and secondly backup all the files and the database prior to undertaking an upgrade. Around half a day should be allowed for preforming an upgrade to allow for the complications that invariably arise.

ikm-wiki-upload

Upgrading MediaWiki is not so simple since there is no ssh access to the server, the following script has been written to make updates easier, it depends on having a local version of ncftp installed, you will need to edit the username and password at the start of the script, it will write data to ~/ikm

To install this script save the following to ~/bin/ as ikm-wiki-upload, make it executable and edit the username and password to ones which work:

#!/bin/bash
 
# username, password and host
FTP_INFO="-u XXXX -p XXXX wiki.ikmemergent.net"
 
# date
DATE_DIR=`date "+%Y-%m-%d"`
 
# local data
LOCAL_DIR=$HOME/ikm/site/html
 
# backup directory
BACKUP_DIR=$HOME/ikm/backups/$DATE_DIR
 
# create the directory for the data
if [ -d "$LOCAL_DIR/wiki" ]; then
 
  # directory exists
  echo ""
 
else
 
  # make the directory 
  mkdir -p $LOCAL_DIR/wiki
 
fi
 
# create a backup
if [ -d "$BACKUP_DIR" ]; then
 
  # backup directory exists
  echo "The site has been backuped today already"
 
else
 
  # make the backup directory and backup the site
  mkdir -p $BACKUP_DIR
 
  # get backup files
  # ncftpget [options] remote-host local-directory remote-files...
  echo "making a backup of the files"
  ncftpget -R $FTP_INFO $BACKUP_DIR html/wiki
 
fi
 
# sync local copy of site with remote data
printf "Do you want to overwrite the local copy of the site with the live site? (y or enter to skip): "
read DOWNLOAD_ALL
if [[ "$DOWNLOAD_ALL" = "y" ]]; then
 
  # ncftpget [options] remote-host local-directory remote-files...
  ncftpget -R $FTP_INFO $LOCAL_DIR/ html/wiki/
 
fi
 
# download uploads 
printf "Do you want to download the uploaded files? (y or enter to skip): "
read DOWNLOAD_FILES
if [[ "$DOWNLOAD_FILES" = "y" ]]; then
 
  # ncftpget [options] remote-host local-directory remote-files...
  ncftpget -R $FTP_INFO $LOCAL_DIR/wiki/files html/wiki/files
 
fi
 
# upload local version of the wiki
printf "Do you want to upload all local files to the live site (this will take ages!)? (y or enter to skip): "
read UPLOAD_ALL
if [[ "$UPLOAD_ALL" = "y" ]]; then
 
  # ncftpput [options] remote-host remote-directory local-files...
  cd $LOCAL_DIR/wiki
  ncftpput -R $FTP_INFO html/wiki *
 
fi
 
# upload captcha images
printf "Do you want to upload the captcha images? (y or enter to skip): "
read UPLOAD_CAPTCHA
if [[ "$UPLOAD_CAPTCHA" = "y" ]]; then
 
  # ncftpput [options] remote-host remote-directory local-files...
  cd $LOCAL_DIR/wiki/captcha
  ncftpput -R $FTP_INFO html/wiki/captcha *
 
fi
 
# upload extensions
printf "Do you want to upload extensions? (y or enter to skip): "
read UPLOAD_EXTENSIONS
if [[ "$UPLOAD_EXTENSIONS" = "y" ]]; then
 
  # ncftpput [options] remote-host remote-directory local-files...
  cd $LOCAL_DIR/wiki/extensions
  ncftpput -R $FTP_INFO html/wiki/extensions *
 
fi
 
 
# upload skins 
printf "Do you want to upload skins? (y or enter to skip): "
read UPLOAD_SKINS
if [[ "$UPLOAD_SKINS" = "y" ]]; then
 
  # ncftpput [options] remote-host remote-directory local-files...
  cd $LOCAL_DIR/wiki/skins
  ncftpput -R $FTP_INFO html/wiki/skins *
 
fi
 
# upload yui
printf "Do you want to upload The Yahoo! User Interface Library? (y or enter to skip): "
read UPLOAD_YUI
if [[ "$UPLOAD_YUI" = "y" ]]; then
 
  # ncftpput [options] remote-host remote-directory local-files...
  cd $LOCAL_DIR/wiki/yui
  ncftpput -R $FTP_INFO html/wiki/yui *
 
fi
 
# upload images
printf "Do you want to upload files? (y or enter to skip): "
read UPLOAD_FILES
if [[ "$UPLOAD_FILES" = "y" ]]; then
 
  # ncftpput [options] remote-host remote-directory local-files...
  cd $LOCAL_DIR/wiki/files
  ncftpput -R $FTP_INFO html/wiki/files *
 
fi
 
# upload LocalSettings.php
printf "Do you want to upload LocalSettings.php? (y or enter to skip): "
read UPLOAD_LOCALSETTINGS
if [[ "$UPLOAD_LOCALSETTINGS" = "y" ]]; then
 
  # ncftpput [options] remote-host remote-directory local-files...
  cd $LOCAL_DIR/wiki
  ncftpput -R $FTP_INFO html/wiki/ LocalSettings.php
 
fi
 
# upload error docs
printf "Do you want to upload error documents? (y or enter to skip): "
read UPLOAD_ERROR
if [[ "$UPLOAD_ERROR" = "y" ]]; then
 
  # ncftpput [options] remote-host remote-directory local-files...
  cd $LOCAL_DIR/wiki
  ncftpput -R $FTP_INFO html/wiki *.shtml
 
fi

The first thing this script does is back up the whole site and as this is 250M of data, as of July 2009, this can take some time if you are doing it on a slow connection. Ideally the script should be installed on a development server with a fast connection.

Upgrading MediaWiki

To start the upgrade process first run the ikm-wiki-upload script to backup the site locally and also to overwrite the local copy of the site with the live site, then backup the MySQL database using the servers PhpMyAdmin interface.

Download the latest version of MediaWiki and overwrite the copy of the files from the server, for example:

cd ~/ikm
wget http://download.wikimedia.org/mediawiki/1.14/mediawiki-1.14.0.tar.gz
tar -zxvf mediawiki-1.14.0.tar.gz
rsync -av mediawiki-1.14.0/ site/html/wiki/
rm mediawiki-1.14.0.tar.gz
rm -rf mediawiki-1.14.0/

If an update of the database schema is required, most upgrades require this, then you need to re-run the installer.

Upgrading the Extensions

Then the extensions should be upgraded.

The subversion installed extensions are:

  1. http://www.mediawiki.org/wiki/Extension:Google_Analytics_Integration
  2. http://www.mediawiki.org/wiki/Extension:ImageMap
  3. http://www.mediawiki.org/wiki/Extension:Lockdown
  4. http://www.mediawiki.org/wiki/Extension:ParserFunctions
  5. http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi
  6. http://www.mediawiki.org/wiki/Extension:ConfirmEdit
  7. http://www.mediawiki.org/wiki/Extension:SpamBlacklist
  8. http://semantic-mediawiki.org/
  9. http://www.mediawiki.org/wiki/Extension:CategoryTree
  10. http://www.mediawiki.org/wiki/Extension:Semantic_Drilldown
  11. http://www.mediawiki.org/wiki/Extension:Semantic_Forms
  12. http://www.mediawiki.org/wiki/Extension:FeedImport

These can easily be upgraded using subversion:

cd ~/ikm/site/html/wiki/extensions/googleAnalytics/
svn up
 
cd ../ImageMap/
svn up
 
cd ../Lockdown/
svn up
 
cd ../ParserFunctions
svn up
 
cd ../SyntaxHighlight_GeSHi
svn up
 
cd ../ConfirmEdit
svn up
 
cd ../SpamBlacklist
svn up
 
cd ../SemanticMediaWiki/
svn up
 
cd ../CategoryTree
svn up
 
cd ../SemanticDrilldown
svn up
 
cd ../SemanticForms
svn up

Semantic Forms also uses a copy of the The Yahoo! User Interface Library (YUI) and this can also be updated:

cd ~/ikm/site/html/wiki/
wget http://developer.yahoo.com/yui/download/
unzip yui_2.7.0b.zip

FeedImport is potentially a bit more complicated because feedimport/feedimport.php contains a customised path in it:

 #define('MAGPIE_DIR',  '/opt/local/lib/php/magpierss/');
 define('MAGPIE_DIR',  '/home/www/web557/html/wiki/extensions/magpierss/');

However subversion can still be used:

cd ~/ikm/site/html/wiki/extensions/feedimport/
svn up

And in addition feedimport depends on magpierss which can be updated using CVS (not that it has been updated for several years):

cd ~/ikm/site/html/wiki/extensions/magpierss
cvs -q up

The extensions that haven't been installed using subversion need to be manually checked and manually updated:

  1. http://www.mediawiki.org/wiki/Extension:Calendar_(Barrylb)
  2. http://www.mediawiki.org/wiki/Extension:ShareThis
  3. http://www.mediawiki.org/wiki/Extension:FramedVideo

FramedVideo is available via FTP and it can be upgraded to the latest version by checking the URL for the latest release and then using ncftpget:

cd ~/ikm/site/html/wiki/extensions/FramedVideo
ncftpget ftp://filop.pl/FramedVideo/1.1.2/*

The other two extensions, the Calendar and ShareThis have to be updated by copying and pasting the code from the extensions site into local files.

Updating the live server

Once all the updates have been applied to the development server and tested then the updated code can be uploaded to the live server, using the ikm-wiki-upload script and finally the special SemanticMediaWiki page should be accessed, Special:SMWAdmin, to run the script for updating the database.

If the Main MediaWiki database needs updating then LocalSettings.php should be backed up and then the installer can be run and then all the customisation to LocalSettings.php should be reinstated.

Sometimes there are updates to the default MonoBook skin, which the IKMEmergent skin is based on, which require that the customised skin be recreated, see the updating the custom skin page for more information on this.

Server Notes

In addition to only having FTP access and no ssh access there appears to be no ImageMagick so it can't be used for thumbnailing of images and there are restrictions on what can be put in .htaccess files so mod_rewrite cannot be used and therefore all wiki URL's have to be long query string based ones, (eg /index.php?title=Help:MediaWiki rather than /Help:MediaWiki).

Navigation
Browse By
Languages
Toolbox