Difference between revisions of "Wiki install"

From Richmond MakerLabs
Jump to navigation Jump to search
(Created page with " Check on [https://www.mediawiki.org/wiki/Manual:Installation_guide mediawiki site] for latest version and edit the wget below accordingly Don't just paste this, you'll have...")
(No difference)

Revision as of 10:29, 8 July 2019

Check on mediawiki site for latest version and edit the wget below accordingly

Don't just paste this, you'll have different versions of things like php etc.

Process for New Install

Assumes backups of sql databases already

sudo apt update && sudo apt dist-upgrade -y
sudo apt install locate apache2 mariadb-server php php-mysql libapache2-mod-php php-xml php-mbstring php-apcu imagemagick php-cli php-curl git -y
sudo apt-get install php-apcu php-intl imagemagick inkscape php-gd php-cli php-curl git
mysql_secure_installation
sudo service apache2 reload
wget https://releases.wikimedia.org/mediawiki/1.33/mediawiki-1.33.0.tar.gz
mysql -u root
mkdir -p  tmp && cd "$_"
tar -xvzf /tmp/mediawiki-*.tar.gz
sudo mkdir /var/lib/mediawiki
sudo mv mediawiki-*/* /var/lib/mediawiki
cd ..
sudo rm -rf tmp
ls /var/lib/mediawiki/
sudo phpenmod mbstring
sudo phpenmod xml
sudo systemctl restart apache2.service
sudo updatedb
cd /var/lib/mediawiki/

locate php.ini

Edit the php for filesizes

Restore the sql wiki database

mysql -u root wiki < ~/2019-05-23_02-00-02-wiki.sql 

Install required skins These can probably go one day, just doing it to keep it in line with previous install otherwise it errors cd /var/www/wiki/images/



Current LocalSettings.php with database settings information removed

Removed Items for posting on wiki

Andy knows where backups are

$wgSecretKey

$wgDBtype = ""; $wgDBserver = ""; $wgDBname = ""; $wgDBuser = ""; $wgDBpassword = "";

Local Settings.php

<?php
# This file was automatically generated by the MediaWiki 1.22.6
# installer. If you make manual changes, please keep track in case you
# need to recreate them later.
#
# See includes/DefaultSettings.php for all configurable settings
# and their default values, but don't forget to make changes in _this_
# file, not there.
#
# Further documentation for configuration settings may be found at:
# http://www.mediawiki.org/wiki/Manual:Configuration_settings

# Protect against web entry
if ( !defined( 'MEDIAWIKI' ) ) {
        exit;
}

## Uncomment this to disable output compression
# $wgDisableOutputCompression = true;

$wgSitename = "Richmond MakerLabs";
$wgMetaNamespace = "Richmond_MakerLabs";

## 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
## (like /w/index.php/Page_title to /wiki/Page_title) please see:
## http://www.mediawiki.org/wiki/Manual:Short_URL
$wgScriptPath = "";
$wgScriptExtension = ".php";

## The protocol and server name to use in fully-qualified URLs
$wgServer = "http://wiki.richmondmakerlabs.uk";

## The relative URL path to the skins directory
$wgStylePath = "$wgScriptPath/skins";

## The relative URL path to the logo.  Make sure you change this from the default,
## or else you'll overwrite your logo when you upgrade!
## $wgLogo             = "/wiki/skins/common/images/wiki.png";
# $wgLogo             = "/skins/common/images/rmllogo1.png";
$wgLogo             = "/skins/common/images/rmllogo3.png";

## UPO means: this is also a user preference option

$wgEnableEmail = true;
$wgEnableUserEmail = true; # UPO

$wgEmergencyContact = "info@richmondmakerlabs.uk";
$wgPasswordSender = "info@richmondmakerlabs.uk";

$wgEnotifUserTalk = false; # UPO
$wgEnotifWatchlist = false; # UPO
$wgEmailAuthentication = true;

## Database settings
$wgDBtype = "";
$wgDBserver = "";
$wgDBname = "";
$wgDBuser = "";
$wgDBpassword = "";

# MySQL specific settings
$wgDBprefix = "wiki_";

# MySQL table options to use during installation or update
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=utf8";

# Experimental charset support for MySQL 5.0.
$wgDBmysql5 = false;

## Shared memory settings
$wgMainCacheType = CACHE_NONE;
$wgMemCachedServers = array();

## To enable image uploads, make sure the 'images' directory
## is writable, then set this to true:
$wgEnableUploads = true;
$wgUseImageMagick = false;
$wgImageMagickConvertCommand = "/usr/bin/convert";

# InstantCommons allows wiki to use images from http://commons.wikimedia.org
$wgUseInstantCommons = false;

## If you use ImageMagick (or any other shell command) on a
## Linux server, this will need to be set to the name of an
## available UTF-8 locale
$wgShellLocale = "en_US.utf8";

## If you want to use image uploads under safe mode,
## create the directories images/archive, images/thumb and
## images/temp, and make them all writable. Then uncomment
## this, if it's not already uncommented:
#$wgHashedUploadDirectory = false;

## Set $wgCacheDirectory to a writable directory on the web server
## to make your wiki go slightly faster. The directory should not
## be publically accessible from the web.
#$wgCacheDirectory = "$IP/cache";

# Site language code, should be one of the list in ./languages/Names.php
$wgLanguageCode = "en";

$wgSecretKey = "";

# Site upgrade key. Must be set to a string (default provided) to turn on the
# web installer while LocalSettings.php is in place
$wgUpgradeKey = "64b92ee4cf2e4085";

## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'cologneblue', 'monobook', 'vector':
 $wgDefaultSkin = "vector";
 wfLoadSkin( 'Vector' );
 $wgMFDefaultSkinClass = 'SkinVector'; // use Vector skin


## For attaching licensing metadata to pages, and displaying an
## appropriate copyright notice / icon. GNU Free Documentation
## License and Creative Commons licenses are supported so far.
$wgRightsPage = ""; # Set to the title of a wiki page that describes your license/copyright
$wgRightsUrl = "";
$wgRightsText = "";
$wgRightsIcon = "";

# Path to the GNU diff3 utility. Used for conflict resolution.
$wgDiff3 = "/usr/bin/diff3";



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

$wgShowExceptionDetails = true;

wfLoadSkin( 'CologneBlue' );
wfLoadSkin( 'Modern' );
wfLoadSkin( 'MonoBook' );
wfLoadSkin( 'Vector' );

# Disable reading by anonymous users
$wgGroupPermissions['*']['read'] = true;

# But allow them to access the login page or else there will be no way to log in!
# [You also might want to add access to "Main Page", "Wikipedia:Help", etc.)
$wgWhitelistRead = array ("Special:Userlogin");

# Disable anonymous editing
$wgGroupPermissions['*']['edit'] = false;

# Prevent new user registrations except by sysops
$wgGroupPermissions['*']['createaccount'] = false;

# Enable Parser Functions
require_once "$IP/extensions/ParserFunctions/ParserFunctions.php";

# Mobile compatibility
wfLoadExtension( 'MobileFrontend' );
$wgMFAutodetectMobileView = true;

wfLoadExtension( 'WikiEditor' );
# Displays the Preview and Changes tabs
$wgDefaultUserOptions['wikieditor-preview'] = 1;
# Enables use of WikiEditor by default but allows users to disable in prefs
$wgDefaultUserOptions['usebetatoolbar'] = 1;
# Displays the Publish and Cancel buttons on the top right side
$wgDefaultUserOptions['wikieditor-publish'] = 1;
# Enable the loading of WikiEditor extension
wfLoadExtension( 'WikiEditor' );
# Enable the loading of Extension:EmbedVideo (Ryan Sayre addition Aug 2016)
wfLoadExtension("EmbedVideo");
# Enable extension TemplateData to calculate 2nd and 4th mondays (IanB Sep 2016)
wfLoadExtension( 'TemplateData' );
// Set this to true to enable the TemplateData GUI editor
$wgTemplateDataUseGUI = true;

# extra files

$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'doc', 'xls', 'mpp', 'pdf', 'svg', 'ppt', 'tiff', 'bmp', 'docx', 'xlsx', 'pptx', 'ps', 'odt', 'ods', 'odp', 'odg' ,'rd', 'rld', 'dxf', 'xlsm' );



# Add new types to the existing list from DefaultSettings.php

$wgFileExtensions[] = 'rld';

$wgFileExtensions[] = 'dxf';

# this is for Google Calendar Widget
# require_once "$IP/extensions/Widgets/Widgets.php";

==regular Backups to be implemented tar of wiki directory Seperate backup of images/ documents Mysql database - regular backup to proxrml