Help:Installation
From Lexicon Leponticum
How to create your own MediaWiki lexicon. Please note that some components used for this project are already out of date and that other versions may not fit together in the way described here.
Contents |
General
- Be aware of what you want. What shall be the content, what shall be the functions and results?
- Be sure that this is the best system available for what you want.
- Prepare your server for PHP and MySQL
- Install MediaWiki (as described there)
- Install the wanted extensions (as described on their download pages)
- Find out the structure of your data.
- Create a display template for each data category
- Create additional templates for special functions (if wanted), like navigation bars or image galleries
- Create a property for each attribute/characteristic/property/feature any item may have
- Create a form for each template
- Create a page for each item of every category by using your forms
- Create some additional pages for general information, automatic lists, and analysis
MediaWiki
Requirements:
- see Mediawiki requirements, basically a webserver with PHP 4 and MySQL 5 installed
1) Install Mediawiki Copy all the files into the directory you want to install it, then open the folder url in a web browser and configure your Wiki. Make sure you choose the full UTF-8 database compability! We recommend the "GNU license" model concerning copyright and InnoDB compatibility. Once configured, move the LocalSettings.php from the config directory in the main directory. Before you upload it, you should also make the following changes in your LocalSettings.php:
Add the following lines to change the permissions so that normal users have no writing permissions soever, don't forget to change the server in the first line:
##Univie LexLep HACKS! $wgServer = "http://www.univie.ac.at"; #fill in your server here $wgGroupPermissions['user' ]['move'] = false; $wgGroupPermissions['user' ]['move-subpages'] = false; $wgGroupPermissions['user' ]['edit'] = false; $wgGroupPermissions['user' ]['createpage'] = false; $wgGroupPermissions['user' ]['writeapi'] = false; $wgGroupPermissions['user' ]['reupload'] = false; $wgGroupPermissions['user' ]['reupload-shared'] = false; $wgGroupPermissions['user' ]['minoredit'] = false; $wgGroupPermissions['user' ]['purge'] = false; $wgGroupPermissions['*' ]['edit'] = false; $wgGroupPermissions['*' ]['createpage'] = false; $wgGroupPermissions['*' ]['writeapi'] = false; $wgGroupPermissions['autoconfirmed']['autoconfirmed'] = false; $wgGroupPermissions['sysop' ]['edit'] = true; $wgGroupPermissions['sysop' ]['createpage'] = true; $wgGroupPermissions['sysop' ]['writeapi'] = true; $wgGroupPermissions['sysop' ]['move'] = true; $wgGroupPermissions['sysop' ]['move-subpages'] = true; $wgGroupPermissions['sysop' ]['edit'] = true; $wgGroupPermissions['sysop' ]['createpage'] = true; $wgGroupPermissions['sysop' ]['writeapi'] = true; $wgGroupPermissions['sysop' ]['reupload'] = true; $wgGroupPermissions['sysop' ]['reupload-shared'] = true; $wgGroupPermissions['sysop' ]['minoredit'] = true; $wgGroupPermissions['sysop' ]['purge'] = true; $wgGroupPermissions['bot' ]['writeapi'] = true; $wgGroupPermissions['editor' ]['move'] = true; $wgGroupPermissions['editor' ]['move-subpages'] = true; $wgGroupPermissions['editor' ]['read'] = true; $wgGroupPermissions['editor' ]['edit'] = true; $wgGroupPermissions['editor' ]['createpage'] = true; $wgGroupPermissions['editor' ]['createtalk'] = true; $wgGroupPermissions['editor' ]['writeapi'] = true; $wgGroupPermissions['editor' ]['upload'] = true; $wgGroupPermissions['editor' ]['reupload'] = true; $wgGroupPermissions['editor' ]['reupload-shared'] = true; $wgGroupPermissions['editor' ]['minoredit'] = true; $wgGroupPermissions['editor' ]['purge'] = true; // can use ?action=purge without clicking "ok"
Also add those lines if you don't want MediaWiki to automatically capitalize all your article names:
# DO NOT CAPITALIZE $wgCapitalLinks = false;
Add the following lines if you want pdf uploads enabled:
/** * This is the list of preferred extensions for uploading files. Uploading files * with extensions not in this list will trigger a warning. */ $wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'pdf' ); $wgEnableUploads = true;
Set the value $wgEnableUploads here to "true" if you want uploads to be enabled. Make sure your "images" directory is writable at the same time.
Add the lines
$wgLogo = "{$wgScriptPath}/images/Logo_Flasche_AEV_Klammer.png";
$wgFavicon = "{$wgScriptPath}/images/favicon.ico";
and create files in those folders if you want a custom Site Logo and favourites icon.
If you are sure you will install those extensions (and if you follow this guide strictly, you will), you can already add the following lines in your LocalSettings.php to install them (but they will cause error messages until you've really copied the files - also note that you will need a google maps app key that you will need to insert in the variable left empty here):
#Semantic Wiki Forms
include_once('extensions/SemanticForms/includes/SF_Settings.php');
#Article Comments
require_once('extensions/ArticleComments/ArticleComments.php');
#AntiBot
require_once( "$IP/extensions/AntiBot/AntiBot.php" );
#Spamblacklist
require_once( "$IP/extensions/SpamBlacklist/SpamBlacklist.php" );
#Bibliography
require_once("$IP/extensions/bibliography/bibliography.php");
#SimpleSecurity
$wgSecurityUseDBHook = true; # this directive MUST be used before the extension include
require('extensions/SimpleSecurity/SimpleSecurity.php');
# All other SimpleSecurity directives MUST be specified after the include or the defaults will override them.
$wgSecurityRenderInfo = true;
$wgSecurityAllowUnreadableLinks = false;
$wgPageRestrictions['Category:Servers']['read'] = 'sysop';
#SimpleAntispam
require_once("$IP/extensions/SimpleAntiSpam/SimpleAntiSpam.php");
#Bad-Behaviour
include_once( 'includes/DatabaseFunctions.php' );
include( './extensions/bad-behavior/bad-behavior-mediawiki.php' );
# Validator
require_once( "$IP/extensions/Validator/Validator.php" );
# Maps
require_once( "$IP/extensions/Maps/Maps.php" );
$egGoogleMapsKey = "insertyourcodehere";
#Semantic Maps
require_once( "$IP/extensions/SemanticMaps/SemanticMaps.php" );
#PdfExport
#require_once("$IP/extensions/PdfExport/PdfExport.php");
#$PdfExportUseHtmlDoc = false;
#Extra Edit buttons (self-made) = ButtonsVisual
require_once("$IP/extensions/ButtonsVisual/extraeditbuttons.php");
#LexLep Edit buttons (self-made) = ButtonsSemantic
require_once("$IP/extensions/ButtonsSemantic/lexlepbuttons.php");
#Parserfunctions
require_once( "$IP/extensions/ParserFunctions/ParserFunctions.php" );
#CharInsert
require_once("$IP/extensions/CharInsert/CharInsert.php");
#SortCode
require_once("$IP/extensions/SortCode/sortcode.php");
#Conditional Show Section
require_once("$IP/extensions/ConditionalShowSection/ConditionalShowSection.php");
#BrowserCheck
require_once("$IP/extensions/BrowserCheck/browsercheck.php");
2) Download and copy the files for all those extensions in their respective folder in the extension directory
See Special:Version
Also copy the extensions provided by us in your extensions directory. Note that you will have to create and edit the following pages in your wiki for the extensions to work as intended:
- Browsercheckmsg
- Copyrightwarning
- Disambiguationspage
- Edittools
- Group-bureaucrat-member
- Group-editor
- Group-editor-member
- Group-sysop-member
- Grouppage-editor
- Licenses
- Pageorder
- Sidebar
3) If you want to be able to enter articles through the url yourdomain.com/wiki/articlename instead of yourdomain.com/wiki/index.php?articlename follow one of the following tutorials to add this feature: Tutorials
The original lexicon leponticum used the following technique (without root access)
which led to the addition of the following lines in the LocalSettings.php:
##Hack to not show index.php for every article $wgArticlePath = "/lexlep/wiki/$1"; # Virtual path (left part of first rewrite rule). MUST be DIFFERENT from the path above! $wgUsePathInfo = true;
and to the following .htaccess file:
RewriteEngine On RewriteRule ^wiki/(.*)$ /lexlep/index.php?title=$1 [PT,L,QSA] RewriteRule ^wiki/*$ /lexlep/index.php [L,QSA] RewriteRule ^/*$ /lexlep/index.php [L,QSA]
4) Replace the main.css file in your skins/monobook folder with the provided main.css file. It ensures that a unicode compatible font is used throughout the site and adds some minor visual changes. Delete all other folders except monobook in your skins directory.
7) To have a more detailed help on Semantic Mediawiki Queries, replace the files SMW_SpecialSearchByProperty.php and SMW_SpecialAsk.php in the extension/SemanticMediaWiki/specials folder (under AskSpecial and SearchTriple) with our files.
8) Add the tag [[Provides service::online maps]] to your coordinate property and edit MediaWiki:Smw_service_online_maps to add or delete links if necessary
9) Add the template "coordinate" with the following content:
[http://stable.toolserver.org/geohack/geohack.php?language=en¶ms={{{1}}}_{{{2}}}_{{{3}}}_{{{4}}} [[coordinate::{{{1}}}{{{2}}} {{{3}}}{{{4}}}]] ]
10) Edit the SMW_Settings and set "NS_TEMPLATE => true," to be able to have Sem Properties in Templates for forms add "NS_FORMS => true," to this list and include the following line in your LocalSettings before including SMW:
#Semantic Wiki Hack - enables forms to have Properties
define("NS_FORMS", 106);
11) Also add to the local settings:
#SMW: Suche $smwgQComparators = "<|>|!|~";
12) If you want that only the editors can view your community portal page, make sure to go to "Protect" in its upper menu and check all write and read options for Administrators only.
Extensions
Extensions usually must be installed like MediaWiki, and some changes or addings have to be made in the MediaWiki settings. See Special:Version for all installed extensions and follow the links for installation instructions.
Templates
- wofür
- Creating a template:
- Go to the "Create a template" page in the Special pages
- It is best to use the same names in the "Field name" box and in the "Display label" box. Unless the "Display label" is filled out, no label will appear on the displayed line! Add a colon if you want one to be displayed on the page. The system does not automatically provide one.
- Additional page ornamentation (html-tags like rules, etc.) have to be inserted into the code of the template.
- verwenden
Properties
Properties are used for the extension Semantic MediaWiki (see there for detailed instruction). They are pages in the namespace Property, but there has to be only a page for a property, if special characteristics like the data type or allowed values shall be defined.
Forms
Forms are used for special pages provided by the extension Semantic Forms (see there for detailed instruction). They are pages in the namespace Form and can be created manually or by using the Special:CreateForm. Within a form there has to be defined
- the field
{{#forminput:templatename}}in thenoincludearea to enter the name of the page that shall be created or edited - the templates for which the form shall be used, with the code
{{{for template|templatename}}} - the fields for each parameter of the templates above, with the code
{{{field|parametername}}} - a field for normal text (i.e. not for templates) will be displayed by the code
{{{standard input|free text}}} - fields for save options like
{{{standard input|save}}}
Example
If there is a template Template:citation with the content
'''{{{lastname}}} {{{year}}}''':<br />
<span style="margin-left:20px;">{{{firstname}}} {{{lastname}}} ''{{{title}}}'' ({{{year}}})</span>
a page using this template can be created or edited with a form like
<noinclude>{{#forminput:citation}}</noinclude>
<includeonly>
{{{for template|citation}}}
*First name: {{{field|firstname}}}
*Last name: {{{field|lastname}}}
*Title: {{{field|title}}}
*Year: {{{field|year}}}
{{{end template}}}
{{{standard input|free text}}}
{{{standard input|save}}}
</includeonly>
If you enter some values in the respective fields of the form, the created page will contain for example:
{{citation
|firstname=Alessandro
|lastname=Morandi
|title=Celti d'Italia
|year=2004
}}
Some additional free text here.
Thus the page will be displayed as
Morandi 2004:
Alessandro Morandi Celti d'Italia (2004)
Some additional free text here.