Difference between revisions of "How to install and configure this wiki"

From Gender and Tech Resources

(ConfirmEdit)
(Extensions)
Line 102: Line 102:
  
 
= Extensions =
 
= Extensions =
 +
go into the extension directory
 +
cd /var/www/html/wiki/extensions
 +
 
== MsUpload ==
 
== MsUpload ==
 
  git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/MsUpload.git
 
  git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/MsUpload.git
Line 148: Line 151:
  
 
== WikiEditor ==
 
== WikiEditor ==
  wget https://extdist.wmflabs.org/dist/extensions/WikiEditor-REL1_24-b13e25d.tar.gz
+
  git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/WikiEditor.git
tar -xzf WikiEditor-REL1_24-b13e25d.tar.gz -C /var/www/html/wiki/extensions
+
rm WikiEditor-REL1_24-b13e25d.tar.gz
+
 
<source lang="php">
 
<source lang="php">
 
# WikiEditor https://www.mediawiki.org/wiki/Extension:WikiEditor
 
# WikiEditor https://www.mediawiki.org/wiki/Extension:WikiEditor
Line 164: Line 165:
  
 
== AdminLinks ==
 
== AdminLinks ==
cd /var/www/html/wiki/extensions
 
 
  git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/AdminLinks.git
 
  git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/AdminLinks.git
 
<source lang="php">
 
<source lang="php">
Line 172: Line 172:
  
 
== Replace Text ==
 
== Replace Text ==
cd /var/www/html/wiki/extensions
 
 
  git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/ReplaceText.git
 
  git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/ReplaceText.git
 
<source lang="php">
 
<source lang="php">
Line 180: Line 179:
  
 
== EmbedVideo ==
 
== EmbedVideo ==
cd /var/www/html/wiki/extensions
 
 
  git clone https://github.com/Alexia/mediawiki-embedvideo.git
 
  git clone https://github.com/Alexia/mediawiki-embedvideo.git
 
  mv mediawiki-embedvideo/ /var/www/html/wiki/extensions/EmbedVideo
 
  mv mediawiki-embedvideo/ /var/www/html/wiki/extensions/EmbedVideo
Line 190: Line 188:
 
== NiceCategoryList ==
 
== NiceCategoryList ==
 
  cd /var/www/html/wiki/extensions/
 
  cd /var/www/html/wiki/extensions/
  mkdir NiceCategoryList
+
  mkdir NiceCategoryList2
 
  cd NiceCategoryList/
 
  cd NiceCategoryList/
 
  nano NiceCategoryList.php
 
  nano NiceCategoryList.php
Line 200: Line 198:
  
 
== DynamicPageList ==
 
== DynamicPageList ==
cd /var/www/html/wiki/extensions
 
 
  git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/intersection.git intersection
 
  git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/intersection.git intersection
 
<source lang="php">
 
<source lang="php">
Line 218: Line 215:
  
 
== SelectCategory ==
 
== SelectCategory ==
cd /var/www/html/wiki/extensions
 
 
  git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/SelectCategory.git
 
  git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/SelectCategory.git
 
<source lang="php">
 
<source lang="php">
Line 226: Line 222:
  
 
== Collection to generate books and PDF ==
 
== Collection to generate books and PDF ==
 +
Git is not for mediawiki v 1.24
 
  wget https://extdist.wmflabs.org/dist/extensions/Collection-REL1_24-f0686fd.tar.gz
 
  wget https://extdist.wmflabs.org/dist/extensions/Collection-REL1_24-f0686fd.tar.gz
 
  tar -xzf Collection-REL1_24-f0686fd.tar.gz -C /var/www/html/wiki/extensions/
 
  tar -xzf Collection-REL1_24-f0686fd.tar.gz -C /var/www/html/wiki/extensions/
Line 243: Line 240:
 
  cd /var/www/html/wiki
 
  cd /var/www/html/wiki
 
  composer require mediawiki/semantic-media-wiki "~2.1"
 
  composer require mediawiki/semantic-media-wiki "~2.1"
3. Run the setup script from the base directory[2] of your MediaWiki installation:
+
3. Run the setup script from the base directory of your MediaWiki installation:
 
  php maintenance/update.php
 
  php maintenance/update.php
 
4. Add a call to enableSemantics() to the end of the "LocalSettings.php" file. enableSemantics() takes in the domain name of the wiki; a wiki located at "example.org", for instance, should have the following call:
 
4. Add a call to enableSemantics() to the end of the "LocalSettings.php" file. enableSemantics() takes in the domain name of the wiki; a wiki located at "example.org", for instance, should have the following call:
Line 384: Line 381:
  
 
=== Installation ===
 
=== Installation ===
 +
the git version is for mediawiki 1.25
 
  wget https://extdist.wmflabs.org/dist/extensions/VisualEditor-REL1_24-af11aa1.tar.gz
 
  wget https://extdist.wmflabs.org/dist/extensions/VisualEditor-REL1_24-af11aa1.tar.gz
 
  tar -xzf VisualEditor-REL1_24-af11aa1.tar.gz -C /var/www/html/wiki/extensions
 
  tar -xzf VisualEditor-REL1_24-af11aa1.tar.gz -C /var/www/html/wiki/extensions

Revision as of 18:07, 15 April 2015

Installation of the wiki

Dependencies

From a freshly install debian testing 64 bits

[*] Web server
[*] SSH server
[*] Standard system utility
su
apt-get update
apt-get upgrade
apt-get install php5 phpmyadmin mysql-server php5-intl php-patchwork-utf8 imagemagick git

For e-mail

apt-get install php-pear
pear install mail
pear install Net_SMTP
dpkg-reconfigure exim4-config

/!\ have to check the mail config so as not to be considered as spam (headers, text of the mail ...)

Download mediawiki

wget http://releases.wikimedia.org/mediawiki/1.24/mediawiki-1.24.2.tar.gz
tar xvzf mediawiki-1.24.2.tar.gz -C /var/www/html/wiki
mv mediawiki-1.24.2 /var/www/html/wiki

Finish mediawiki configuration

open in a browser http://127.0.0.1/wiki/

and install threw this process the following extensions :

# Enabled Extensions. Most extensions are enabled by including the base extension file here
# but check specific extension documentation for more details
# The following extensions were automatically enabled:
require_once "$IP/extensions/Cite/Cite.php";
require_once "$IP/extensions/Gadgets/Gadgets.php";
require_once "$IP/extensions/ImageMap/ImageMap.php";
require_once "$IP/extensions/InputBox/InputBox.php";
require_once "$IP/extensions/Nuke/Nuke.php";
require_once "$IP/extensions/ParserFunctions/ParserFunctions.php";
require_once "$IP/extensions/Renameuser/Renameuser.php";
require_once "$IP/extensions/SpamBlacklist/SpamBlacklist.php";
require_once "$IP/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php";
require_once "$IP/extensions/TitleBlacklist/TitleBlacklist.php";


# End of automatically generated settings.
# Add more configuration options below.

Configurations

Upload settings

allow apache to write in the upload folder

chown -R www-data:www-data /var/www/html/wiki/images

Modify the php.ini file

nano /etc/php5/apache2/php.ini

line 660

post_max_size = 100M

line 810

upload_max_filesize = 100M

line 1002

mail.log = syslog

Modify the Localsettings.php file

#####################################################################
# Increase Shell memory (default 100 MB)                            #
#####################################################################

$wgMaxShellMemory = 512000;
#####################################################################
# User configuration : only email confirmed users can edit & upload #
#####################################################################
# doc: http://www.mediawiki.org/wiki/Manual:User_rights_management
# Sign up for a new account
$wgGroupPermissions['*']['createaccount']=true;
# Edit once email is confirmed
$wgGroupPermissions['*']['edit']=false;
$wgGroupPermissions['*']['createpage']=false;
$wgGroupPermissions['*']['createtalk']=false;
$wgGroupPermissions['emailconfirmed']['upload'] = true; // Allow regular users to upload files
$wgGroupPermissions['emailconfirmed']['upload_by_url'] = true;
$wgGroupPermissions['emailconfirmed']['edit'] = true;
#####################################################################
# Upload configuration : only some mime types are allowed           #
#####################################################################
# doc: https://www.mediawiki.org/wiki/Manual:Configuration_settings#Uploads
$wgEnableUploads = true;
$wgAllowCopyUploads = true;
$wgCopyUploadsFromSpecialUpload = true;
$wgUseImageMagick = true;
$wgImageMagickConvertCommand = "/usr/bin/convert";
$wgFileExtensions = array( 'bmp', 'doc', 'docx', 'flac', 'gif', 'ico', 'jpeg', 'jpg', 'mp3', 'mpp', 'odg', 'odp', 'ods', 'odt', 'ogg', 'pdf', 'epub', 'png', 'ppt', 'pptx', 'ps', 'rtf', 'svg$
$wgAllowJavaUploads = true; // Solves problem with Office 2007 and newer files (docx, xlsx, etc.)
$wgMimeDetectorCommand = "file -bi";
$wgVerifyMimeType = false;

Extensions

go into the extension directory

cd /var/www/html/wiki/extensions

MsUpload

git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/MsUpload.git
# MsUpload https://www.mediawiki.org/wiki/Extension:MsUpload
require_once "$IP/extensions/MsUpload/MsUpload.php";
$wgMSU_showAutoCat = true; // If true, files uploaded while editing a category will be added to that category
$wgMSU_checkAutoCat = true; // Whether the checkbox for the above mentioned case is checked by default
$wgMSU_imgParams = '400px'; // The default parameters for inserted images
$wgMSU_useDragDrop = true; // Should the drag & drop area be shown?
$wgMSU_useMsLinks = false; // Should we allow to insert links in the style of the Extension:MsLinks?

PdfHandler

git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/PdfHandler.git
# PdfHandler https://www.mediawiki.org/wiki/Extension:PdfHandler
require_once "$IP/extensions/PdfHandler/PdfHandler.php";
$wgPdfProcessor = '/usr/bin/gs'; 
$wgPdfPostProcessor = $wgImageMagickConvertCommand; // if defined via ImageMagick
// $wgPdfPostProcessor = '/usr/bin/convert';  // if not defined via ImageMagick
$wgPdfInfo = '/usr/bin/pdfinfo'; 
$wgPdftoText = '/usr/bin/pdftotext';

Ajouter "case 'pdf':" ligne 122 in extensions/MsUpload.js :

        if ( $.inArray( file.extension, wgFileExtensions ) !== -1 ) {
                switch( file.extension ) {
                        case 'jpg': case 'jpeg': case 'png': case 'gif': case 'bmp': case 'tif': case 'tiff': case 'pdf': // pictures

ConfirmEdit

git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/ConfirmEdit.git
# ConfirmEdit https://www.mediawiki.org/wiki/Extension:ConfirmEdit
require_once "$IP/extensions/ConfirmEdit/ConfirmEdit.php";
require_once "$IP/extensions/ConfirmEdit/QuestyCaptcha.php";
$wgCaptchaClass = 'QuestyCaptcha';
$wgCaptchaQuestions[] = array(
  'question' => "What is the first word in the name of this wiki (lowercase) ?",
  'answer' => "gender");
$wgGroupPermissions['emailconfirmed']['skipcaptcha'] = true;
$ceAllowConfirmedEmail = true;
$wgEmailConfirmToEdit = true;

WikiEditor

git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/WikiEditor.git
# WikiEditor https://www.mediawiki.org/wiki/Extension:WikiEditor
require_once "$IP/extensions/WikiEditor/WikiEditor.php";
## Enables use of WikiEditor by default but still allow users to disable it in preferences
$wgDefaultUserOptions['usebetatoolbar'] = 1;
$wgDefaultUserOptions['usebetatoolbar-cgd'] = 1;
## Displays the Preview and Changes tabs
$wgDefaultUserOptions['wikieditor-preview'] = 1;
## Displays the Publish and Cancel buttons on the top right side
$wgDefaultUserOptions['wikieditor-publish'] = 1;

AdminLinks

git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/AdminLinks.git
# Admin links https://www.mediawiki.org/wiki/Extension:Admin_Links
require_once("$IP/extensions/AdminLinks/AdminLinks.php");

Replace Text

git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/ReplaceText.git
# Replace Text https://www.mediawiki.org/wiki/Extension:Replace_Text
require_once( "$IP/extensions/ReplaceText/ReplaceText.php" );

EmbedVideo

git clone https://github.com/Alexia/mediawiki-embedvideo.git
mv mediawiki-embedvideo/ /var/www/html/wiki/extensions/EmbedVideo
# EmbedVideo http://www.mediawiki.org/wiki/Extension:EmbedVideo
require_once "$IP/extensions/EmbedVideo/EmbedVideo.php";

NiceCategoryList

cd /var/www/html/wiki/extensions/
mkdir NiceCategoryList2
cd NiceCategoryList/
nano NiceCategoryList.php

paste in the file the content of : http://www.mediawiki.org/wiki/Extension:NiceCategoryList2/3.0 (! no git nor downloadable v3 file ...)

# NiceCategoryList http://www.mediawiki.org/wiki/Extension:NiceCategoryList2
include_once("$IP/extensions/NiceCategoryList/NiceCategoryList.php");

DynamicPageList

git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/intersection.git intersection
# Dynamic Page List https://www.mediawiki.org/wiki/Extension:DynamicPageList_%28Wikimedia%29
require_once("$IP/extensions/intersection/DynamicPageList.php");
# Configuration variables. Warning: These use DLP instead of DPL
# for historical reasons (pretend Dynamic list of pages)
$wgDLPmaxCategories = 6;                // Maximum number of categories to look for
$wgDLPMaxResultCount = 200;             // Maximum number of results to allow
$wgDLPAllowUnlimitedResults = false;    // Allow unlimited results
$wgDLPAllowUnlimitedCategories = false; // Allow unlimited categories
// How long to cache pages using DPL's in seconds. Default to 1 day. Set to
// false to use the normal amount of page caching (most efficient), Set to 0 to disable
// cache altogether (inefficient, but results will never be outdated)
$wgDLPMaxCacheTime = 60*60*24;          // How long to cache pages in seconds

SelectCategory

git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/SelectCategory.git
# SelectCategory https://www.mediawiki.org/wiki/Extension:SelectCategory
require_once( 'extensions/SelectCategory/SelectCategory.php' );

Collection to generate books and PDF

Git is not for mediawiki v 1.24

wget https://extdist.wmflabs.org/dist/extensions/Collection-REL1_24-f0686fd.tar.gz
tar -xzf Collection-REL1_24-f0686fd.tar.gz -C /var/www/html/wiki/extensions/
rm Collection-REL1_24-f0686fd.tar.gz
# Collection PDF https://www.mediawiki.org/wiki/Extension:Collection
require_once "$IP/extensions/Collection/Collection.php";

/!\ needs more config and test while the server is accessible from internet /!\

Semantic MediaWiki

Install

1. First, install composer :

curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer

2. Run the installation scriptfrom the base directory of your MediaWiki installation:

cd /var/www/html/wiki
composer require mediawiki/semantic-media-wiki "~2.1"

3. Run the setup script from the base directory of your MediaWiki installation:

php maintenance/update.php

4. Add a call to enableSemantics() to the end of the "LocalSettings.php" file. enableSemantics() takes in the domain name of the wiki; a wiki located at "example.org", for instance, should have the following call:

nano /var/www/html/wiki/LocalSettings.php
enableSemantics( 'tacticaltech.org/wikigti' );

Update

Use these instructions to update an existing SMW installation.

  1. Backup your database and installation.
  2. Run the update script from the base directory[1] of your MediaWiki installation:[2]
    php composer.phar update
  3. See the page "Special:Version" on your wiki to verify that the extension was successfully updated.
  4. Run the setup script from the base directory[1] of your MediaWiki installation:
    php maintenance/update.php
  5. Run the refresh database script from the base directory[1] of your MediaWiki installation:[3]
    php extensions/SemanticMediaWiki/maintenance/SMW_refreshData.php -d 50 -v
  6. Done!

Semantic Drilldown

# Semantic Drilldown https://www.mediawiki.org/wiki/Extension:Semantic_Drilldown
include_once("$IP/extensions/SemanticDrilldown/SemanticDrilldown.php");

Semantic Forms

git clone https://git.wikimedia.org/git/mediawiki/extensions/SemanticForms.git
# Semantic Forms https://www.mediawiki.org/wiki/Extension:Semantic_Forms
include_once "$IP/extensions/SemanticForms/SemanticForms.php";

Semantic Forms Inputs

git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/SemanticFormsInputs.git
# Semantic Forms Inputs https://www.mediawiki.org/wiki/Extension:Semantic_Forms_Inputs
require_once("$IP/extensions/SemanticFormsInputs/SemanticFormsInputs.php");


Semantic Compound Queries

git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/SemanticCompoundQueries.git
# Semantic Compound Queries http://www.mediawiki.org/wiki/Extension:Semantic_Compound_Queries
require_once( "$IP/extensions/SemanticCompoundQueries/SemanticCompoundQueries.php" );

Maps

cd /var/www/html/wiki/
composer require mediawiki/maps "*"

it doesn't require any call in the LocalSettings.php as composer mecanism autoload it

# Maps http://www.mediawiki.org/wiki/Extension:Maps
# https://github.com/JeroenDeDauw/Maps/blob/master/docs/INSTALL.md


Semantic Maps

cd /var/www/html/wiki/
composer require mediawiki/semantic-maps "*"

it doesn't require any call in the LocalSettings.php as composer mecanism autoload it

# Semantic Maps https://www.mediawiki.org/wiki/Extension:Semantic_Maps
# https://github.com/SemanticMediaWiki/SemanticMaps/blob/master/docs/INSTALL.md

Language Bundle

https://www.mediawiki.org/wiki/MediaWiki_Language_Extension_Bundle

cd /var/www/html/wiki/extensions
for ext in Babel cldr CleanChanges LocalisationUpdate Translate UniversalLanguageSelector
do
  if [ ! -d "$ext" ]
  then
    git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/$ext.git
  fi
  cd $ext; git fetch --tags; git checkout 2015.03; cd ..
done

Modify the LocalSettings.php

# Language Bundle https://www.mediawiki.org/wiki/MediaWiki_Language_Extension_Bundle
require_once "$IP/extensions/Babel/Babel.php";

require_once "$IP/extensions/cldr/cldr.php";

require_once "$IP/extensions/CleanChanges/CleanChanges.php";
$wgCCTrailerFilter = true;
$wgCCUserFilter = false;
$wgDefaultUserOptions['usenewrc'] = 1;

require_once "$IP/extensions/LocalisationUpdate/LocalisationUpdate.php";
$wgLocalisationUpdateDirectory = "$IP/cache";

require_once "$IP/extensions/Translate/Translate.php";
$wgGroupPermissions['emailconfirmed']['translate'] = true;
$wgGroupPermissions['emailconfirmed']['translate-messagereview'] = true;
$wgGroupPermissions['emailconfirmed']['translate-groupreview'] = true;
$wgGroupPermissions['emailconfirmed']['translate-import'] = true;
$wgGroupPermissions['sysop']['pagetranslation'] = true;
$wgGroupPermissions['sysop']['translate-manage'] = true;
$wgTranslateDocumentationLanguageCode = 'qqq';
$wgExtraLanguageNames['qqq'] = 'Message documentation'; # No linguistic content. Used for documenting messages

require_once "$IP/extensions/UniversalLanguageSelector/UniversalLanguageSelector.php";

And then proceed to the following

Update database tables

Command line

In the directory where your LocalSettings.php is located, run the following command:

php maintenance/update.php

Web browser

Go to example.com/mediawiki/mw-config/ by using your domain and path and rerun install.

Configuring LocalisationUpdate

If you are on unix-like system, you should add LocalisationUpdate to crontab:

crontab -e
# Add the following line
@daily php /path/to/your/wiki/extensions/LocalisationUpdate/update.php --quiet

VisualEditor

Dependencies

VisualEditor depends on the following extension:

To install it, do as root :

gpg --keyserver keys.gnupg.net --recv-keys 5C927F7C
gpg -a --export 5C927F7C | apt-key add -
nano /etc/apt/sources.list file

Add the parsoid repository to your /etc/apt/sources.list file

deb [arch=amd64] http://parsoid.wmflabs.org:8080/deb wmf-production main

To install,

sudo apt-get update && sudo apt-get install parsoid
nano /etc/mediawiki/parsoid/settings.js

Open the config file in /etc/mediawiki/parsoid/settings.js and update it to reflect your API URL

parsoidConfig.setInterwiki( 'localhost', 'http://localhost/wiki/api.php' );

Installation

the git version is for mediawiki 1.25

wget https://extdist.wmflabs.org/dist/extensions/VisualEditor-REL1_24-af11aa1.tar.gz
tar -xzf VisualEditor-REL1_24-af11aa1.tar.gz -C /var/www/html/wiki/extensions
rm VisualEditor-REL1_24-af11aa1.tar.gz

Add the following lines to your wiki's LocalSettings.php after you have downloaded the extension:

# VisualEditor http://www.mediawiki.org/wiki/Extension:VisualEditor
require_once "$IP/extensions/VisualEditor/VisualEditor.php";
// Enable by default for everybody
$wgDefaultUserOptions['visualeditor-enable'] = 1;
// Don't allow users to disable it
$wgHiddenPrefs[] = 'visualeditor-enable';
// OPTIONAL: Enable VisualEditor's experimental code features
#$wgDefaultUserOptions['visualeditor-enable-experimental'] = 1;

To get VisualEditor to talk to Parsoid, add the following code to your LocalSettings.php to specify your Parsoid instance:

// URL to the Parsoid instance
// MUST NOT end in a slash due to Parsoid bug
// Use port 8142 if you use the Debian package
$wgVisualEditorParsoidURL = 'http://localhost:8142';

/!\ Restart nodejs after install /!\

/etc/init.d/parsoid restart


MwEmbed

git clone https://github.com/kaltura/mwEmbed.git
mkdir cache
chown www-data:www-data cache/
# MwEmbed https://github.com/kaltura/mwEmbed
// Auth testing sets
$wgKalturaAuthHTTPS = false;
$wgKalturaAuthDomains = array( 'localhost', 'kgit.html5video.org', 'html5video.org', 'player.kaltura.com' );

MwEmbedSupport

git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/MwEmbedSupport.git
# MwEmbedSupport https://www.mediawiki.org/wiki/Extension:MwEmbedSupport
require_once "$IP/extensions/MwEmbedSupport/MwEmbedSupport.php";


TimedMediaHandler

apt-get install libav-tools ffmpeg2theora oggvideotools
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/TimedMediaHandler.git
# TimedMediaHandler https://www.mediawiki.org/wiki/Extension:TimedMediaHandler
// TimedMediaHandler is dependent on mwEmbedSupport 
// TimedMediaHandler
require_once( "$IP/extensions/TimedMediaHandler/TimedMediaHandler.php" );

This extension also requires schema changes, so run update.php after installing.

cd /var/www/html/wiki
php maintenance/update.php

Skins

Foreground

cd /var/www/html/wiki/skins
git clone https://github.com/thingles/foreground.git
# Foreground https://github.com/thingles/foreground
require_once "$IP/skins/foreground/foreground.php";









Deprecated (for memory)

Semantic Bundle

apt-get install zip p7zip-full
cd /var/www/html/wiki/extensions
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/SemanticBundle.git
make
cp SemanticBundle-20150409.tgz /var/www/html/wiki/extensions/
cd ..
tar xvf SemanticBundle-20150409.tgz
rm SemanticBundle-20150409.tgz
cd SemanticBundle/
cp SemanticBundleSettings.sample.php SemanticBundleSettings.php

Then, include SemanticBundleSettings.php and SemanticBundle.php within LocalSettings.php:

require_once( "$IP/extensions/SemanticBundle/SemanticBundleSettings.php" );
require_once( "$IP/extensions/SemanticBundle/SemanticBundle.php" );

The next step is to initialize Semantic MediaWiki. First, make sure that you are logged in as an administrator/sysop, such as the WikiSysop user. Then, go to Special:SMWAdmin, and click on the "Initialize or upgrade tables" button.

http://192.168.1.78/wiki/index.php/Special:SMWAdmin

After successful initialization, open up SemanticBundleSettings.php and uncomment the extensions you would like to use. It looks like :

<?php

/**
 * SemanticBundle - A pre-packaged bundle of extensions meant to be used on wikis
 * based around the Semantic MediaWiki extension.
 *
 * Sample of the settings file for the Semantic Bundle
 *
 * @link https://www.mediawiki.org/wiki/Extension:Semantic_Bundle Documentation
 *
 * @file SemanticBundleSettings.php
 * @ingroup SemanticBundle
 */

if ( !defined( 'MEDIAWIKI' ) ) {
    echo "This file is not a valid entry point.";
    exit( 1 );
}

# Semantic MediaWiki basic installation.
# More info: http://semantic-mediawiki.org/wiki/Help:Installation

# First, all of SMW's current dependencies.
# This includes adding autoload calls for the classes that would normally
# be autoloaded by Composer.
$classMap = require_once( "$IP/extensions/SemanticBundle/SB_AutoloadClassmap.php" );
foreach ( $classMap as $className => $fileName ) {
        $wgAutoloadClasses[$className] = $fileName;
}
include_once( "$IP/extensions/SemanticBundle/param-processor/param-processor/src/ParamProcessor/Processor.php" );
include_once( "$IP/extensions/SemanticBundle/param-processor/param-processor/DefaultConfig.php" );
include_once( "$IP/extensions/Validator/Validator.php" );

include_once( "$IP/extensions/SemanticMediaWiki/SemanticMediaWiki.php" );
enableSemantics( parse_url( $wgServer, PHP_URL_HOST ) );

# Semantic Result Formats
# More info: http://semantic-mediawiki.org/wiki/Help:Semantic_Result_Formats#Installation
#include_once( "$IP/extensions/SemanticResultFormats/SemanticResultFormats.php" );

# Semantic Forms
# More info: https://www.mediawiki.org/wiki/Extension:Semantic_Forms
include_once( "$IP/extensions/SemanticForms/SemanticForms.php" );

# Semantic Forms Inputs
# More info: https://www.mediawiki.org/wiki/Extension:Semantic_Forms_Inputs
include_once( "$IP/extensions/SemanticFormsInputs/SemanticFormsInputs.php" );

# Semantic Compound Queries
# More info: https://www.mediawiki.org/wiki/Extension:Semantic_Compound_Queries
#include_once( "$IP/extensions/SemanticCompoundQueries/SemanticCompoundQueries.php" );

# Semantic Drilldown
# More info: https://www.mediawiki.org/wiki/Extension:Semantic_Drilldown#Installation
include_once( "$IP/extensions/SemanticDrilldown/SemanticDrilldown.php" );

# Maps and Semantic Maps 
include_once( "$IP/extensions/Maps/Maps.php" );
include_once( "$IP/extensions/SemanticMaps/SemanticMaps.php" );

# Semantic Extra Special Properties
# More info: https://www.mediawiki.org/wiki/Extension:Semantic_Extra_Special_Properties
#include_once( "$IP/extensions/SemanticExtraSpecialProperties/SemanticExtraSpecialProperties.php" );

# Semantic Tasks
# More info: https://www.mediawiki.org/wiki/Extension:Semantic_Tasks#Installation
# include_once( "$IP/extensions/SemanticTasks/SemanticTasks.php" );

# Semantic Internal Objects
# More info: https://www.mediawiki.org/wiki/Extension:Semantic_Internal_Objects
#include_once( "$IP/extensions/SemanticInternalObjects/SemanticInternalObjects.php" );

# Semantic Image Input
# More info: https://www.mediawiki.org/wiki/Extension:Semantic_Image_Input
#include_once( "$IP/extensions/SemanticImageInput/SemanticImageInput.php" );

# Admin Links
# More info: https://www.mediawiki.org/wiki/Extension:Admin_Links#Installation
include_once( "$IP/extensions/AdminLinks/AdminLinks.php" );

# Approved Revs
# More info: https://www.mediawiki.org/wiki/Extension:Approved_Revs#Installation
#include_once( "$IP/extensions/ApprovedRevs/ApprovedRevs.php" );

# Arrays
# More info: https://www.mediawiki.org/wiki/Extension:Arrays#Installation
include_once( "$IP/extensions/Arrays/Arrays.php" );

# Data Transfer
# More info: https://www.mediawiki.org/wiki/Extension:Data_Transfer#Installation
#include_once( "$IP/extensions/DataTransfer/DataTransfer.php" );

# External Data
# More info: https://www.mediawiki.org/wiki/Extension:External_Data#Installation
#include_once( "$IP/extensions/ExternalData/ExternalData.php" );

# Header Tabs
# More info: https://www.mediawiki.org/wiki/Extension:Header_Tabs#Installation
include_once( "$IP/extensions/HeaderTabs/HeaderTabs.php" );

# Page Schemas
# More info: https://www.mediawiki.org/wiki/Extension:Page_Schemas#Installation
#require_once( "$IP/extensions/PageSchemas/PageSchemas.php" );

# Replace Text
# More info: https://www.mediawiki.org/wiki/Extension:Replace_Text#Installation
require_once( "$IP/extensions/ReplaceText/ReplaceText.php" );

# Widgets
# Also need to do some permission setup: http://www.mediawiki.org/wiki/Extension:Widgets#Folder_permissions
# More info: https://www.mediawiki.org/wiki/Extension:Widgets#Installation
require_once( "$IP/extensions/Widgets/Widgets.php" );
$wgGroupPermissions['sysop']['editwidgets'] = true;

note for myself : Semantic Tasks and Approved Revs seem to cause troubles (database)
  1. Cite error: Invalid <ref> tag; no text was provided for refs named base
  2. Cite error: Invalid <ref> tag; no text was provided for refs named comglob
  3. This is an optional step to take to assure that the semantic store is valid and up to date.