Home » Featured, MediaWiki

How to run Maintenance scripts on MediaWiki without Shell Access.

30 July 2009 545 views 2 Comments

MediaWiki is very popular for wiki creation. Though it is so much used, the irony is, most of settings has to be set using LocalSettings.php file. Also the maintenance scripts has to be run by command prompt. Maintenance scripts are used for various update task on MediaWiki.

Recently I faced a problem in MediaWiki update. My requirement was to prevent users from creating the account by themselves. The account creation request should be validated by moderator and then it is accepted or rejected. I found a ConfirmAccount extension which does the exactly what I wanted. Now comes the problem. It is specified in installation steps of ConfirmAccount that I will have to run one of the maintenance scripts. My hosting account does not provide me shell access (1$/month account).
I search and found another extension MaintenanceShell, which emulates the shell environment so Mediawiki will think that the script is run inside shell terminal. It is very simple to install and then use.

Installation steps:
1: Download the extension package from here.
2: extract and copy the folder to wikidir/extensions/MaintenanceShell (name should be exact same)
3. copy following lines to end of your LocalSettings.php file.

# Sysops will have access to the MaintenanceShell
$wgGroupPermissions['sysop']['maintenanceshell'] = true;

#Place this on the VERY LAST line of your Localsettings.php file:
require_once(“$IP/extensions/MaintenanceShell/MaintenanceShell.php”);

It is important that “require_once” line is the last line in the file.

First line tells that sysop group will have access to maintenanceshell. MaintenanceShell adds a new user right called maintenanceshell, which a user must be granted before they can access the MaintenanceShell page. You can change to existing group or add the group here.

Usage:
After going to your wiki page. Click on “Special pages” from left side panel. Under “Wiki data and tools” you will find a new link called “Maintenance Shell”. Click on this Link. A page will open with two text boxes and list of all available maintenance scripts. Write the name of the script you want to run in first text box or click on the list below. You can provide the arguments in the second text box (optional). And Voila, scripts runs without shell access to server!!

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • Facebook
  • Google Bookmarks
  • email
  • MySpace
  • Twitthis
  • Yahoo! Bookmarks
  • Twitter
(No Ratings Yet)
Loading ... Loading ...

2 Comments »

  • Frantik said:

    Glad you find the extension useful :)

  • tawan said:

    WOW that is a savior, thanks.

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.