Full Installation Instructions

From SemanticOrganization
Revision as of 13:20, 22 June 2022 by Admin (talk | contribs)
Jump to: navigation, search

Full Installation

Create database

mysql> create database DBNAME;
mysql> create user DBUSER@localhost identified by 'DBPASS';
mysql> grant all on DBNAME.* to DBUSER@localhost;

Replace DBNAME with the name of your database, DBUSER with the name of the database user and DBPASS with the password you've chosen.

Download MediaWiki

wget https://releases.wikimedia.org/mediawiki/1.35/mediawiki-1.35.6.tar.gz
tar xvzf mediawiki-1.35.6.tar.gz 
mv mediawiki-1.35.6 w
rm mediawiki-1.35.6.tar.gz


Download Tweeki Skin

cd w/skins/
git clone https://github.com/thaider/Tweeki

Download extensions

cd ../extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/PageForms.git
cd PageForms
git checkout 731d226
cd ..
git clone https://github.com/thaider/SemanticOrganization


Install Semantic MediaWiki and Semantic Result Formats

If you don't already have it, install Composer first.

Create a composer.local.json file and require the extensions:

cd ..
cp composer.local.json-sample composer.local.json
COMPOSER=composer.local.json composer require --no-update mediawiki/semantic-media-wiki:~3.2
COMPOSER=composer.local.json composer require --no-update mediawiki/semantic-result-formats:~3.2
composer update --no-dev

Run Installation Procedure

Open mydomain.tld/w and follow the instructions, chose Tweeki as a standard skin, activate ParserFunctions, Page Forms, and Semantic Organization extensions. It is recommended to use semorg only with private wikis (only registered users are allowed to read and edit the wiki).

add the following to LocalSettings.php:

# Use Tweeki as default skin
$wgDefaultSkin = 'tweeki';

# Show Tweeki's advanced features by default
$wgDefaultUserOptions['tweeki-advanced'] = 1;

# Use Bootstrap Tooltips
$wgTweekiSkinUseTooltips = true;

# Enable String Functions
$wgPFEnableStringFunctions = true;

# Enable Semantic MediaWiki
enableSemantics('YOURDOMAIN.TLD');
$smwgEnabledEditPageHelp = false;
$smwgLinksInValues = true;
$smwgPageSpecialProperties[] = '_CDAT';

# Settings for Page Forms
$wgPageFormsAutocompleteOnAllChars = true;

# Allow display titles for automatically created page names
$wgRestrictDisplayTitle = false;

# Encode section IDs with modern html5 style so Scrollspy works with special chars
# becomes obsolete with MW 1.37
$wgFragmentMode = [ 'html5', 'legacy' ];

# Use full screen width when no sidebar is shown
$wgTweekiSkinGridNone = [ 
  "mainoffset" => 0, 
  "mainwidth" => 12
];
php maintenance/install.php --dbname=DBNAME --dbuser=DBUSER --dbpass=DBPASS --scriptpath=/w --lang=en --pass=USERPASS "WIKINAME" "USERNAME"
php maintenance/update.php --skip-external-dependencies

Replace DBNAME, DBUSER and DBPASS with the respective values.

add the following to LocalSettings.php:

# Loading extensions
wfLoadExtension('ParserFunctions');
wfLoadExtension('PageForms');
wfLoadExtension('SemanticOrganization');
wfLoadExtension( 'SemanticResultFormats' );

# Make Wiki private
$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['*']['read'] = false;
$wgGroupPermissions['*']['edit'] = false;

# Use Tweeki as default skin
$wgDefaultSkin = 'tweeki';

# Show Tweeki's advanced features by default
$wgDefaultUserOptions['tweeki-advanced'] = 1;

# Use Bootstrap Tooltips
$wgTweekiSkinUseTooltips = true;

# Enable String Functions
$wgPFEnableStringFunctions = true;

# Enable Semantic MediaWiki
enableSemantics('YOURDOMAIN.TLD');
$smwgEnabledEditPageHelp = false;
$smwgLinksInValues = true;
$smwgPageSpecialProperties[] = '_CDAT';

# Settings for Page Forms
$wgPageFormsAutocompleteOnAllChars = true;

# Allow display titles for automatically created page names
$wgRestrictDisplayTitle = false;

# Encode section IDs with modern html5 style so Scrollspy works with special chars
# becomes obsolete with MW 1.37
$wgFragmentMode = [ 'html5', 'legacy' ];

# Use full screen width when no sidebar is shown
$wgTweekiSkinGridNone = [ 
  "mainoffset" => 0, 
  "mainwidth" => 12
];

Import Semorg Pages

Import the default templates, forms and categories:

php maintenance/importDump.php < extensions/SemanticOrganization/import/semorg_pages.xml

Cleanup after import:

php maintenance/rebuildrecentchanges.php
php maintenance/runJobs.php

Apache Setup

In order for Visual Editor to work in forms you might have to add this line to your vhost's definition:

AllowEncodedSlashes NoDecode