Arbores MediaWiki installation: Difference between revisions
Line 46: | Line 46: | ||
* Infomaniak: Manager -> Applications -> w (cliquer sur "configurer") | * Infomaniak: Manager -> Applications -> w (cliquer sur "configurer") | ||
Step 3: Add rewrite rules for the subdomain | '''Step 3: Add rewrite rules for the subdomain''' | ||
In the .htaccess root file, add: | In the .htaccess root file, add: | ||
Line 58: | Line 58: | ||
On the wiki side you will have to do two things, add a rewrite rule and change Localsettings.php | On the wiki side you will have to do two things, add a rewrite rule and change Localsettings.php | ||
'''Step 4: Add rewrite Rules''' | |||
* Read: [https://www.mediawiki.org/wiki/Manual:Short_URL Short URL] | * Read: [https://www.mediawiki.org/wiki/Manual:Short_URL Short URL] | ||
* Use the [https://shorturls.redwerks.org/ MediaWikiShortURLBuilder] | * Use the [https://shorturls.redwerks.org/ MediaWikiShortURLBuilder] | ||
Edit /.htaccess (add to the above) | |||
<source lang="bash"> | |||
RewriteEngine On | |||
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f | |||
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d | |||
RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/w/index.php [L] | |||
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f | |||
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d | |||
RewriteRule ^/?w/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/w/thumb.php?f=$1&width=$2 [L,QSA,B] | |||
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f | |||
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d | |||
RewriteRule ^/?w/images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/w/thumb.php?f=$1&width=$2&archived=1 [L,QSA,B] | |||
</source> | |||
To LocalSetting: | |||
<source lang="bash"> | |||
## The URL base path to the directory containing the wiki; | |||
## defaults for all runtime URL paths are based off of this. | |||
## For more information on customizing the URLs please see: | |||
## http://www.mediawiki.org/wiki/Manual:Short_URL | |||
$wgScriptPath = "/w"; | |||
$wgScriptExtension = ".php"; | |||
$wgArticlePath = "{$wgScriptPath}/$1"; | |||
$wgUsePathInfo = true; | |||
## To enable image uploads, make sure the 'images' directory | |||
## is writable, then set this to true: | |||
$wgEnableUploads = true; | |||
$wgGenerateThumbnailOnParse = false; | |||
</source> | |||
== Builtin extensions == | == Builtin extensions == |
Revision as of 16:12, 8 April 2021
Introduction
This page includes installation notes for this wiki.
Change permission
By default, anyone can create an account and contribute. To change:
$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['*']['read'] = true;
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['*']['createpage'] = false;
$wgGroupPermissions['*']['move'] = false;
$wgGroupPermissions['*']['createtalk'] = false;
$wgGroupPermissions['*']['upload'] = false;
$wgGroupPermissions['*']['reupload'] = false;
$wgGroupPermissions['*']['reupload-shared'] = false;
$wgGroupPermissions['*']['minoredit'] = false;
$wgGroupPermissions['sysop' ]['move'] = true;
$wgGroupPermissions['sysop' ]['read'] = true;
$wgGroupPermissions['sysop' ]['edit'] = true;
$wgGroupPermissions['sysop' ]['createpage'] = true;
$wgGroupPermissions['sysop' ]['createtalk'] = true;
$wgGroupPermissions['sysop' ]['upload'] = true;
$wgGroupPermissions['sysop' ]['reupload'] = true;
$wgGroupPermissions['sysop' ]['reupload-shared'] = true;
$wgGroupPermissions['sysop' ]['minoredit'] = true;
$wgGroupPermissions['sysop' ]['userrights'] = true;
$wgGroupPermissions['sysop' ]['noratelimit'] = true;
Short URL
On the hosting side, you will need a subdomain if possible (not necessary though)
Step 1: Add a subdomain
For Infomaniak hosting: Read
- Ajouter un site ou un sous-domaine avec un fichier .htaccess
- Ajouter un (domaine) alias à un site Web
Step 2: Fix the site URL (if it was installed with the provider's "manager")
- Read Applications Web: modifier l'adresse Web (URL) / Changer le nom de domaine
- Infomaniak: Manager -> Applications -> w (cliquer sur "configurer")
Step 3: Add rewrite rules for the subdomain
In the .htaccess root file, add:
RewriteCond %{HTTP_HOST} ^(.*)\.domain\.com [NC]
RewriteCond %{DOCUMENT_ROOT}/%1/ -d
RewriteCond %1::%{REQUEST_URI} !^(.*?)::/\1/?
RewriteRule "^(.*)$" "%{DOCUMENT_ROOT}/%1/$1" [L]
On the wiki side you will have to do two things, add a rewrite rule and change Localsettings.php
Step 4: Add rewrite Rules
- Read: Short URL
- Use the MediaWikiShortURLBuilder
Edit /.htaccess (add to the above)
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/w/index.php [L]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^/?w/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/w/thumb.php?f=$1&width=$2 [L,QSA,B]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^/?w/images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/w/thumb.php?f=$1&width=$2&archived=1 [L,QSA,B]
To LocalSetting:
## The URL base path to the directory containing the wiki;
## defaults for all runtime URL paths are based off of this.
## For more information on customizing the URLs please see:
## http://www.mediawiki.org/wiki/Manual:Short_URL
$wgScriptPath = "/w";
$wgScriptExtension = ".php";
$wgArticlePath = "{$wgScriptPath}/$1";
$wgUsePathInfo = true;
## To enable image uploads, make sure the 'images' directory
## is writable, then set this to true:
$wgEnableUploads = true;
$wgGenerateThumbnailOnParse = false;
Builtin extensions
Server requirements
An installed wiki comes with preinstalled extensions that you can enable. However, some of these do not work on shared hosting, e.g.
- Visual editor requires a node.js server
Others require a change in server configuration, e.g.
- SyntaxHighlight requires shell access. To enable this on Infomaniak, enable it (but evaluate the risks, if a portal is hacked the others will be too).
open the Manager (manager.infomaniak.com) go to Hosting click on the hosting/domain name concerned under Sites, click on the domain name of the site concerned click onA dvanced parameters click on the PHP Tab put exect, shell_exec, etc. on.
CategoryTree
wfLoadExtension ('CategoryTree');
Cite
https://www.mediawiki.org/wiki/Extension:Cite
Makes <ref> </ref> for citations available.
Read Help:Cite
wfLoadExtension ('Cite');
CiteThisPage
wfLoadExtension ('CiteThisPage');
CodeEditor
(to test/do)
wfLoadExtension ('CodeEditor');
InputBox
(to test/do)
wfLoadExtension ('InputBox');
MultimediaViewer
(to test/do)
wfLoadExtension ('MultimediaViewer');
ParserFunctions
Adds some extra language elements to the parser. Needed for some templates.
wfLoadExtension ('ParserFunctions');
ConfirmEdit
(to test/do) wfLoadExtension ('ConfirmEdit');
Gadgets
wfLoadExtension ('Gadgets');
ImageMap
wfLoadExtension ('ImageMap');
Lockdown
wfLoadExtension ('Lockdown');
PageImages
wfLoadExtension ('PageImages');
Interwiki
wfLoadExtension ('Interwiki');
LocalisationUpdate
wfLoadExtension ('LocalisationUpdate');
Nuke
wfLoadExtension ('Nuke');
OATHAuth
wfLoadExtension ('OATHAuth');
Poem
wfLoadExtension ('Poem');
Scribunto
wfLoadExtension ('Scribunto');
TemplateData
wfLoadExtension ('TemplateData');
PdfHandler
wfLoadExtension ('PdfHandler');
Renameuser
wfLoadExtension ('Renameuser');
ReplaceText
wfLoadExtension ('ReplaceText');
SecureLinkFixer
wfLoadExtension ('SecureLinkFixer');
SpamBlacklist
wfLoadExtension ('SpamBlacklist');
TitleBlacklist
wfLoadExtension ('TitleBlacklist');
Syntaxhighlight
https://www.mediawiki.org/wiki/Extension:SyntaxHighlight
In Linux, set execute permissions for the pygmentize binary. You can use an FTP client or the following shell command to do so:
chmod a+x /path/to/extensions/SyntaxHighlight_GeSHi/pygments/pygmentize
In Local Settings, add:
wfLoadExtension( 'SyntaxHighlight_GeSHi' );
TextExtracts
wfLoadExtension ('TextExtracts');
VisualEditor
wfLoadExtension ('VisualEditor');
WikiEditor
Adds some useful extras to the standard built-in wiki code editor. Priority installation.
wfLoadExtension ('WikiEditor');