User:Al Maghi/Industrialization guide

From MediaWiki.org

Jump to: navigation, search

Guidebook to industrialize production of wikis running on MediaWiki engine. It describes the whole process, in three steps: Installation, Configuration & Importation of basic-content.

This is not a technical reference manual, it is a guidebook to process wiki production.

Contents

[edit] Overview

To get wiki-web-sites running on MediaWiki you need to distinguish two separate technical roles:

Network administration:

  • The first technical role is to be responsible for the MediaWiki server; you need someone at ease with web server administration.
    • As a network administrator, he/she is responsible for back-up, upgrade, accessibility and security of the web server.
    • All he/she has to be furthermore responsible for is to install and set up MediaWiki to serve the chosen URL, to accept file upload and to render LaTeX formula; and then to open up an SSH-ftp access for the second role.

MediaWiki configuration:

  • The second technical role is to be responsible for the MediaWiki configuration; you need someone to be responsible for the wiki functionalities. Let's call him/her wiki-administrator.
    • He/She needs an SSH-ftp access to LocalSettings.php file, /extensions and /skins folders.
    • He/She has to be available for wiki users to set up the desired functionalities.

Management:

  • Other roles are about wiki's administration and edition:
    • Bureaucrats: they manage user rights
    • Administrators: they edit MediaWiki interface and skin, through MediaWiki namespace. They delete unused content. They write templates, do maintenance.
    • Users: they read and edit the wiki.

[edit] Processing a MediaWiki production

  1. Installation of Mediawiki server (Linux, Apache, MySQL, PHP) → Server administrator.
    1. creation of database
    2. installation of server tools
    3. configuration of user authentication
  2. Configuration of MediaWiki wiki-web-siteMediaWiki expert.
    1. interface and skin
    2. extensions
    3. user rights definition
  3. Management: content & user management → Knowledge Manager.

[edit] Installing MediaWiki web server, with a network administrator

All the network admin needs to know is:

  • Name of the wiki
  • Language of the wiki
  • E-mail contact of the wiki-administrator
  • Username of the wiki-administrator
  • Chosen URL of the wiki
  • For user registration,
    • is the LDAP authentication wanted?
    • By default managers create accounts for users. Is it preferred that a potential user ask for an account then managers confirm account creation? Then a ConfirmAccount extension would be installed.
  • Desired extensions requiring server tools.

Once he has finished he shall give an SSH-ftp access to LocalSettings.php, to /extensions, and to /skins. Back-up, upgrade, accessibility and security of the web server is under his responsibility.

[edit] Installation: server, database, directories, config script

Reference manuals: Installation · Category:Installation

[edit] Set up LocalSettings.php and move it to its parent directory

[edit] Short URL

See: Manual:Short URL

[edit] Other settings: PHP's memory, images, TeX, third-party server tools

Before handing over to wiki-administrator we will add some lines to LocalSettings.php, to configure PHP’s memory, image upload and LaTeX render:

[edit] Raise PHP's memory limit in LocalSettings.php
ini_set( 'memory_limit', '1000M' );
[edit] Set up image upload
Manual:Image Administration
$wgEnableUploads       = true;
$wgUseImageResize      = true;
$wgUseImageMagick 	= true;
$wgImageMagickConvertCommand = "/usr/bin/convert";
 
## If you use ImageMagick (or any other shell command) on a
## Linux server, this will need to be set to the name of an
## available UTF-8 locale
$wgShellLocale = "en_US.UTF-8";
 
## If you want to use image uploads under safe mode,
## create the directories images/archive, images/thumb and
## images/temp, and make them all writable. Then uncomment
## this, if it's not already uncommented:
$wgHashedUploadDirectory = false;
 
## You trust your users
$wgAllowExternalImages = "true";
$wgStrictFileExtensions = false;
$wgFileExtensions = array( 'svg', 'doc', 'gif', 'xls', 'avi', 'mpg', 'mpp', 'pdf', 'zip', 'mm');
$wgUploadSizeWarning = false;
$wgMaxUploadSize = 1024*1024*1000; // 1Go upload permission
$wgCheckFileExtensions = false;
$wgVerifyMimeType = false;     // Disable mime type detection 
 
$wgAllowImageMoving = true; 
 
$wgUploadDirectory = "images";
$wgMathPath = "{$wgUploadPath}/math";
$wgMathDirectory = "{$wgUploadDirectory}/math";
$wgTmpDirectory = "{$wgUploadDirectory}/tmp";

You can test the image upload through the [[Special:Upload]] page by logging-in with wiki-administrator account.

[edit] LaTeX setting
Manual:Enable TeX

Install OCaml on the server then configure LocalSettings.php with $wgUseTex = true;

You can test LaTeX by writing a formula on main page: <math>x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}</math>

Tip: A simple alternative is to use Mimetex extension.
[edit] Closing lines
$wgAllowSlowParserFunctions = true;
$wgUseAjax = true;
###--- End of Network & System Administration settings ---###
#
###--- Start of Wiki Administration settings ---###

[edit] Hand over to wiki-administrator

Create an SSH-ftp access for wiki-administrator and send him its username and its temporary password.

He has the necessary tools to get the functionalities he would like on the wiki web site. Some further optional tools may need a system admin intervention, they are described below.

[edit] Optional tools:

See: Manual:Installing third-party tools

[edit] Lucene powerful search

Extension:MWSearch

[edit] LDAP Authentication

Extension:LDAP Authentication

[edit] Confim account creation by bureaucrat

Extension:ConfirmAccount

[edit] Video player

Extension:VPIPPlugin

[edit] PDF render for collection of articles

http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/Collection/README.txt

[edit] GraphViz to render graphs

Extension:GraphViz

[edit] Plotters to plot graphs

The gnuplot and ploticus extensions have fairly major security risks. An alternative is using the Plotters extension with Plotkit (or another javascript graphing library of your choice). This is a javascript-only solution, but most corporate environments require javascript.

[edit] Setting the wiki configuration, with a wiki-administrator

The MediaWiki web site is empty, available to the given URL

The wiki-administrator configures the wiki interface, its functionality and the user rights.

Requirement are:

  • having a SSH-ftp access and a sysop account
  • browsing and using the Special Pages of the wiki
  • reading and editing LocalSettings.php file

Required softwares are:

  • a powerful web browser (such as Firefox)
  • a powerful text editor (such as Emacs or Notepad++)
  • a powerful SSH-ftp client (such as Filezilla)
  • (recommended) an SSH console (such as Putty.exe)
Process
  1. Change your password: log in with the given wiki-administrator username and then change your password through your [[Special:Preferences]] page.
  2. Use your SSH-ftp access to open the file LocalSettings.php. It is located in mediawiki root directory named /w.

[edit] Logo and favicon images

  • Create a 135x135 logo and a 32x32 favicon and upload them using [[Special:Upload]] page or directly through SSH-ftp.
  • Add at bottom of LocalSettings.php the following lines, adapted with the correct images’ paths:
# Here is the location of the small 135x135 logo that go at the upper left corner of every page
$wgLogo = "$wgScriptPath/images/8/80/wikiLogo.png";
# Here is the favicon in reader's browser
$wgFavicon = "$wgScriptPath/images/3/50/favicon.ico";

Save, upload those changes to server, and reload a wiki page in a browser to see the changes.

[edit] Extra namespaces

See Manual:Namespace
$wgExtraNamespaces[100] = "Portal";
$wgExtraNamespaces[101] = "Portal_talk";
$wgNamespacesWithSubpages = array_fill(0, 200, true); //every NS has subpages
$wgNamespaceAliases = array(
        'U' => NS_USER,
        'P' => 100    // P:pagename => Portal:pagename
    );

[edit] Choose user default options

In LocalSettings.php is defined what are the default user option preferences, applying to new user accounts. You probably want to change some default user options: See Manual:$wgDefaultUserOptions

You’ll be able to change registered user options by running the UserOptions.php maintenance script.

[edit] User rights

In LocalSettings.php is defined what right is needed to do what operation.

You define permission of groups then you manage what users belong to what group.

  • anonymous users [should they have the right to edit? To read?]
  • registered users [they should have the right to read and edit non restricted content.]
    • Optional group. [plus access to restricted content.]
    • admin. [can delete content]
    • bureaucrat. (can change user rights)

You probably want to add those permissions:

# Disable reading by anonymous users
$wgGroupPermissions['*']['read'] = false;
 
# But allow them to read these pages:
$wgWhitelistRead =  array ( "Main Page", "Special:Userlogin", "Help:Contents");
 
# Prevent new user registrations except by sysops
$wgGroupPermissions['*']['createaccount'] = false;

Basically there are 4 groups: anonymous users (cannot read), registered users (cannot delete content nor protect pages), sysops (cannot change user rights) and bureaucrats (those who manage users’ rights).

You could add some extra groups and define new group permissions and new content restrictions. The page [[Special:ListGroupRights]] lists every group with its associated rights.

For example if you want to restrict some categorized pages and a whole namespace, you will write something like below:

## Extension:SimpleSecurity
$wgSecurityUseDBHook = true; # Add this to enable the experimental DB hook for stronger security
include("$IP/extensions/SimpleSecurity/SimpleSecurity.php");
$wgSecurityRenderInfo = true; 
$wgSecurityAllowUnreadableLinks = false;
$wgSecurityExtraGroups = array(
     'groupA' => 'Top Managers group',
     'groupB' => 'Marketers group'	
);
$wgPageRestrictions['Category:Market']['read'] = array('groupA', 'groupB');  //Pages that are categorized into Market pages
$wgPageRestrictions['Category:Market']['edit'] = array('groupA', 'groupB');  //are restricted to group A and B, 
$wgPageRestrictions['Category:Market']['move'] = array('groupA', 'groupB');  //users not belonging to any group cannot read them.
$wgPageRestrictions['Namespace:Private']['read'] = 'groupA'; //Pages in Private namespace (Private:Pagename)
$wgPageRestrictions['Namespace:Private']['edit'] = 'groupA'; //are restricted 
$wgPageRestrictions['Namespace:Private']['move'] = 'groupA'; //to users belonging to group A.

[edit] Create user accounts

Once you’ve defined the default user options you can create accounts to register wiki-users. You should start to register users that will have some administration rights, so that they could manage other users by themselves. Go to [[Special:UserLogin]], click on “create an account”, fill in username and email and use the “by e-mail” button. User will receive a temporary password and will be asked to change it at their first connection.

Figure 4 - registration form accessible through [[Special:UserLogin]]

Notice that if the network administrator has installed an LDAP authentication or a confirm account creation by bureaucrat, user registration will be managed differently. In the second case it is up to users to ask for their account creation; and to bureaucrats to confirm or not. Check Special:Version to see if those extensions are installed or not.


Figure 5 - Bureaucrat report to confirm account requests; using a database extension

Assign user rights

Go to [[Special:UserRights]], to give extra rights to users, such as bureaucrat rights for managers and sysop rights for pro-active users.


Figure 6 - assignment of Bureaucrat rights to managers through [[Special:UserRights]]

[edit] Footer links

a. Remove the “Powered by MediaWiki” icon. You can hide the “Powered by MediaWiki” image by adding the following to your wiki's [[MediaWiki:Common.css]]:

#f-poweredbyico { display: none; }

(Note: MediaWiki:Common.css is a page in MediaWiki namespace that applies cascading style sheet to every user.)

b. Change footer links Look at the wiki footer links (privacy policy, disclaimers, etc.) and if you want to change those, go into /Skins/MonoBook.php where you will find the following code:

$footerlinks = array(
	'lastmod', 'viewcount', 'numberofwatchingusers', 'credits', 'copyright', 'privacy', 'about', 'disclaimer', 'tagline',
);

In the above you can simply add and remove items from the array that you wish to appear in your footer. For example we’ve changed it this way:

$footerlinks = array(
	'lastmod', 'viewcount', 'numberofwatchingusers', 'about', 'tagline',
);

[edit] Extensions

See Category:Corporate Must-have extensions

Look at the /extensions directory. Those are extensions you can add to LocalSettings.php to make them available on the wiki. Check the special page Special:Version which lists every installed extensions.

Some extensions you may want could be missing in the repertory fulfilled from MediaWiki SVN, such as:

You can download those missing extensions from MediaWiki and add them manually to /extensions directory through SSH-ftp.

The main extensions for enterprise use are listed above, comment the unwanted extensions.

################ Extension Chapter of LocalSettings.php
#
# MediaWiki Extensions
#
############ See http://www.mediawiki.org/
require_once( "$IP/extensions/OpenSearchXml/OpenSearchXml.php" ); # Extension:OpenSearchXml
$wgEnableMWSuggest = "true"; //search suggestions & highlight:
$wgAdvancedSearchHighlighting = "true";
$wgSearchHighlightBoundaries = "true";
require_once( "$IP/extensions/ParserFunctions/ParserFunctions.php" ); # Extension:ParserFunctions
require_once('extensions/Cite/Cite.php'); # Extension to allow use of footnotes
//require_once("$IP/extensions/embed_document.php"); # Embed document extension.
require_once("{$IP}/extensions/CategoryTree/CategoryTree.php"); 
$wgCategoryTreeSidebarRoot = "Main"; // Is category:Main existing ?
//require_once( "$IP/extensions/FCKeditor/FCKeditor.php" ); # Extension:WYSWYG FCKeditor //$wgFCKEditorExcludedNamespaces
# UsabilityInitiative extension
require_once("$IP/extensions/UsabilityInitiative/UsabilityInitiative.php");
require_once("$IP/extensions/UsabilityInitiative/PrefStats/PrefStats.php");
require_once( "$IP/extensions/UsabilityInitiative/NavigableTOC/NavigableTOC.php" );
require_once( "$IP/extensions/UsabilityInitiative/EditToolbar/EditToolbar.php" );
require_once( "$IP/extensions/UsabilityInitiative/EditWarning/EditWarning.php" );
$wgPrefStatsTrackPrefs = array( 'skin' => 'vector', 'usebetatoolbar' => 1 );
$wgGroupPermissions['sysop']['prefstats'] = true;
$wgPrefStatsTimeUnit = 60*60*24;
#enable the toolbar global: 
$wgEditToolbarGlobalEnable = true;
 
require_once("$IP/extensions/CharInsert/CharInsert.php"); # Extension:CharInsert: Edit tools below edit box
require_once( "{$IP}/extensions/Intersection/DynamicPageList.php" );
//include('extensions/FreeMind.php');
//require_once("$IP/extensions/Collection/Collection.php");
require_once( "$IP/extensions/Gadgets/Gadgets.php");
require_once("extensions/SubPageList3/SubPageList3.php"); //<splist/>
require_once($IP.'/extensions/InputBox/InputBox.php'); // <inputbox>
require_once("$IP/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php");
//require_once("extensions/articletocategory.php"); #Add article to cat. box
require_once("$IP/extensions/ImageMap/ImageMap.php");  // clickable image map
require_once("$IP/extensions/Renameuser/SpecialRenameuser.php");
 
//require_once 'extensions/SpecialUploadLocal/SpecialUploadLocal.php';
// $wgUploadLocalDirectory = $IP.'/extensions/SpecialUploadLocal/images'; //// need an ftp access to extensions folder
require_once( "{$IP}/extensions/Contributors/Contributors.php" );
require_once( "$IP/extensions/ContributorsAddon/ContributorsAddon.php" );
require_once('extensions/Interwiki/SpecialInterwiki.php');
$wgGroupPermissions['*']['interwiki'] = false;
$wgGroupPermissions['sysop']['interwiki'] = true;
require_once( "$IP/extensions/ContributionScores/ContributionScores.php" );
 $wgContribScoreIgnoreBots = true;          // Exclude Bots from the reporting - Can be omitted.
 $wgContribScoreIgnoreBlockedUsers = true;  // Exclude Blocked Users from the reporting - Can be omitted.
 $wgContribScoreDisableCache = false;       // Set to true to disable cache for parser function and inclusion of table
 //Each array defines a report - 7,50 is "past 7 days" and "LIMIT 50" - Can be omitted.
 $wgContribScoreReports = array(
    array(7,50),				// Last 7 days, top 50 users
    array(14,50),				// Last 14 days, top 50 users
    array(21,50),				// Last 21 days, top 50 users
	array(30,50),				// Last 30 days, top 50 users
    array(0,50));
require_once( "$IP/extensions/UsageStatistics/SpecialUserStats.php" );
 $wgUserStatsGoogleCharts = 1;	// default 0 is using GNUplot tool if installed on server
require_once("$IP/extensions/MultiBoilerplate/MultiBoilerplate.php");
 $wgMultiBoilerplateOptions = false;
require_once("$IP/extensions/MostRevisors/MostRevisors.php");
require_once("$IP/extensions/CooperationStatistics/CooperationStatistics.php");
## categorization extensions
// require_once( 'extensions/CategorySuggest/CategorySuggest.php");
// require_once( 'extensions/SelectCategory/SelectCategory.php' );
## Events or Calendar extensions
//include("extensions/events/Events.php");
//include("includes/SpecialEvents.php");
#require_once("$IP/extensions/Calendar/Calendar.php");
# $wgExtraNamespaces[106] = "Calendars";
# $wgExtraNamespaces[107] = "Calendars_talk";
# $wgNamespacesWithSubpages[106] = true;
# $wgNamespacesWithSubpages[107] = true;
//require_once( "$IP/extensions/TopTenPages.php" );
//$wgGroupPermissions['bureaucrat']['maintenanceshell'] = true; # maintenanceShell permission
//require_once("$IP/extensions/MaintenanceShell/MaintenanceShell.php"); // this line must remain last 
//--removal of all suggestions to use MaintenanceShell. Suggestion of ^demon

[edit] Optional tasks:

Those tasks do not need any ftp access and may be performed by pro-active users with sysop rights.

[edit] Add some extra-edit buttons

See: Manual:Custom edit buttons

[[MediaWiki:Edittools]] to add some edit tools below the edit box.

[[MediaWiki:Common.js]] to add some extra-buttons to the editbar above the editbox.

Example:

if (mwCustomEditButtons) {
 
   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://***/w/images/e/e9/Button_headline2.png",
     "speedTip": "level 3 headline",
     "tagOpen": "=== ",
     "tagClose": " ===",
     "sampleText": "Sub-headline text"};
}

[edit] Import JavaScript and CSS style sheets

[edit] Customize MediaWiki messages

[[Special:AllMessages]] Lists every MediaWiki messages.

[edit] Import some basic content such as templates

[edit] Teach users how to use the wiki

In green how to edit; in red how to follow-up; in blue how to navigate

Do not believe that users will find how to contribute on the wiki; even if you’ve written a help page, you should teach them how to navigate, edit and follow-up the wiki.

[edit] Do some maintenance tasks

Maintenance reports through [[Special:SpecialPages]]
Maintenance tasks for every user

Some special pages list what maintenance is needed. They are listed in [[Special:SpecialPages]] in the “Maintenance reports” section, as shown below. A regular task is to categorize uncategorized content:

Maintenance tasks for Administrators

Administrators have the right to delete files and pages, so they should sometimes check for unused content to delete it. Notice that deleted content can be restored therefore you can give sysop rights to every pro-active user without any danger.

Maintenance tasks for the wiki-administrator

Some maintenance scripts can be executed through SSH access. For example to change registered-users' options by running the UserOptions.php maintenance script.

Automated tasks with bots
Help:Bots

[edit] Importing first-level content

See Importing some content from mediawiki.org

At the moment there is not a wiki dedicated to first-import on wikimedia servers.

Recommended solution is to install somewhere a wiki dedicated to your organization first-import. It will be the repository of your organization's gadgets, messages, help and templates.

If divers configurations are needed on your wikis, install somewhere else another wiki with a clean history, on which each revision correspond to a configuration; and import its content with meaningful revision summaries. Earliest revision is the default configuration and users can switch to older revisions.


Once the process is over, welcoming users could be performed at a workshop: users co-operate the first edits of pages and categories; and as they're using the wiki they imagine its future.

[edit] See also