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

From Gender and Tech Resources

(Extensions)
Line 244: Line 244:
 
</source>
 
</source>
 
/!\ needs more config and test while the server is accessible from internet /!\
 
/!\ needs more config and test while the server is accessible from internet /!\
 +
 +
 +
= Skins =
 +
== Foreground ==
 +
cd /var/www/html/wiki/skins
 +
git clone https://github.com/thingles/foreground.git
 +
<source lang="php">
 +
# Foreground https://github.com/thingles/foreground
 +
require_once "$IP/skins/foreground/foreground.php";
 +
</source>
 +
 +
= Deprecated (for memory) =
  
 
== Semantic Bundle ==
 
== Semantic Bundle ==
Line 381: Line 393:
 
note for myself : Semantic Tasks and Approved Revs seem to cause troubles (database)
 
note for myself : Semantic Tasks and Approved Revs seem to cause troubles (database)
  
</source>
 
 
= Skins =
 
== Foreground ==
 
cd /var/www/html/wiki/skins
 
git clone https://github.com/thingles/foreground.git
 
<source lang="php">
 
# Foreground https://github.com/thingles/foreground
 
require_once "$IP/skins/foreground/foreground.php";
 
 
</source>
 
</source>

Revision as of 17:20, 13 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/LocalisationUpdate/LocalisationUpdate.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

#####################################################################
# 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

MsUpload

wget https://extdist.wmflabs.org/dist/extensions/MsUpload-REL1_24-29e0f38.tar.gz
tar -xzf MsUpload-REL1_24-29e0f38.tar.gz -C /var/www/html/wiki/extensions
rm MsUpload-REL1_24-29e0f38.tar.gz
# 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

apt-get install poppler-utils
wget https://extdist.wmflabs.org/dist/extensions/PdfHandler-REL1_24-0bc0148.tar.gz
tar -xzf PdfHandler-REL1_24-0bc0148.tar.gz -C /var/www/html/wiki/extensions
rm PdfHandler-REL1_24-0bc0148.tar.gz
# 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

wget https://extdist.wmflabs.org/dist/extensions/ConfirmEdit-REL1_24-3813252.tar.gz
tar -xzf ConfirmEdit-REL1_24-3813252.tar.gz -C /var/www/html/wiki/extensions
rm ConfirmEdit-REL1_24-3813252.tar.gz
# 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

wget https://extdist.wmflabs.org/dist/extensions/WikiEditor-REL1_24-b13e25d.tar.gz
tar -xzf WikiEditor-REL1_24-b13e25d.tar.gz -C /var/www/html/wiki/extensions
rm WikiEditor-REL1_24-b13e25d.tar.gz
# 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

cd /var/www/html/wiki/extensions
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

cd /var/www/html/wiki/extensions
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

cd /var/www/html/wiki/extensions
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 NiceCategoryList
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

cd /var/www/html/wiki/extensions
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

cd /var/www/html/wiki/extensions
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' );

UniversalLanguageSelector

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

Collection to generate books and PDF

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 /!\


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)