MediaWiki

Install
$ cd /opt/ $ git clone https://gerrit.wikimedia.org/r/p/mediawiki/core.git mediawiki $ cd mediawiki $ git clone https://gerrit.wikimedia.org/r/p/mediawiki/vendor.git $ cd skins $ git clone https://git.wikimedia.org/git/mediawiki/skins/Vector.git $ git checkout  $ git checkout master  # default $ git checkout 1.18.2  # tag for current (2012-04) version
 * http://www.mediawiki.org/wiki/Manual:Installation
 * http://www.mediawiki.org/wiki/Manual:Installing_MediaWiki
 * http://www.mediawiki.org/wiki/Download_from_Git

$ wget https:// raw.githubusercontent.com/musinsky/config/master/MediaWiki/mediawiki.conf -P /etc/httpd/conf.d/ $ systemctl restart httpd.service

Config script
http://localhost/mediawiki/mw-config/index.php
 * http://www.mediawiki.org/wiki/Manual:Config_script

All settings will be temporally caching in your browser
 * Connect to database
 * Database type: MySQL
 * Database host: localhost
 * Database name: strela_wiki
 * Database table prefix:
 * Database username: root
 * Database password: 


 * Database settings
 * Use the same account as for installation [uncheck]
 * Database username: wikiuser
 * Database password: 
 * Create the account if it does not already exist [check]
 * Storage engine: InnoDB
 * Database character set: Binary
 * Settings will be saved in file


 * Name
 * Name of wiki: StrelaWiki
 * Project namespace: Other (specify): StrelaWiki
 * Administrator account
 * Your name: WikiAdmin
 * Password: 
 * E-mail address: musinsky@gmail.com
 * Ask me more question [check]
 * Settings will be saved in MySQL database (which will be created soon)


 * Options
 * User rights profile: Authorized editors only
 * Settings will be later changed in file
 * Settings will be later changed in file


 * Install
 * Only now MediaWiki installer create MySQL database and  file

Complete
Save and move generated file to the main wiki directory $ mv /home/musinsky/LocalSettings.php /opt/mediawiki/ $ chmod 600 /opt/mediawiki/LocalSettings.php $ chown apache:apache /opt/mediawiki/LocalSettings.php Delete the directory

Upgrade
$ cd /opt/mediawiki/ $ git pull $ php maintenance/update.php
 * http://www.mediawiki.org/wiki/Manual:Upgrading

Backup
Backup MediaWiki (MySQL database + images + LocalSettings.php + others) script. Execute as root user (needed permissions to read file) $ wget https://raw.githubusercontent.com/musinsky/config/master/MediaWiki/wiki-backup.sh 
 * http://www.mediawiki.org/wiki/Manual:Backing_up_a_wiki


 * ToDo: https://www.mediawiki.org/wiki/Manual:DumpBackup.php, https://www.mediawiki.org/wiki/Manual:DumpUploads.php, https://www.mediawiki.org/wiki/Manual:Importing_XML_dumps

Moving
Ensure that your "fresh install" consists of the same version of MediaWiki
 * http://www.mediawiki.org/wiki/Manual:Moving_a_wiki
 * 1)  Backup Backup the database and MediaWiki files
 * 2)  Install Re-create the database, user and permissions
 * 3) * create database username: wikiuser with database password: 'sql_wiki_passwd'
 * 4) * create database name: strela_wiki with all privileges for wikiuser
 * 5) Move
 * 6) Modify (created file) / copy (previous wiki settings) file  $ chmod 600 LocalSettings.php; chown apache:apache LocalSettings.php
 * 7) Import the MediaWiki files (copy all MediaWiki files, images/math, images/thumb, images/tmp ) $ chown -R apache:apache images/; chmod -R 755 images/
 * 8) Import the database backup $ mysql --user=wikiuser --password strela_wiki < strela_wiki-dump_YYYY-MM-DD.sql
 * 9) Update the database $ php /opt/mediawiki/maintenance/update.php


 * ToDo
 * https://www.mediawiki.org/wiki/API:Main_page


 * https://www.mediawiki.org/wiki/Manual:Reduce_size_of_the_database
 * https://www.mediawiki.org/wiki/Manual:DeleteOldRevisions.php
 * https://www.mediawiki.org/wiki/Manual:DeleteArchivedRevisions.php

$ php maintenance/deleteOldRevisions.php 27 # 27 is page id for MediaWiki on strela Delete old revisions Limiting to page IDs 27 Searching for active revisions...done. Searching for inactive revisions...done. 21 old revisions found.

Configuration

 * http://www.mediawiki.org/wiki/Manual:Configuration
 * http://www.mediawiki.org/wiki/Manual:System_message


 * http://www.mediawiki.org/wiki/Manual:LocalSettings.php

The file provides local configuration settings (based on the  file) of a MediaWiki. $wgServer              = "http://strela.jinr.ru"; $wgLogo                = "$wgScriptPath/images/strela_logo.png"; $wgFavicon             = "$wgScriptPath/images/strela_icon.png"; $wgShowExceptionDetails = true;

Short URL

 * http://www.mediawiki.org/wiki/Manual:Short_URL

$wgScriptPath = "/mediawiki"; $wgArticlePath = "/wiki/$1"; $wgUsePathInfo = true;

$ wget https://raw.githubusercontent.com/musinsky/config/master/MediaWiki/mediawiki.conf



File uploads
Uploaded files will be distributed into sub-directories of  based on the first two characters of the md5 hash of the filename. If is false, all images are uploaded in  itself $ chown -R apache:apache /opt/mediawiki/images/ $ chmod -R 755 /opt/mediawiki/images/
 * http://www.mediawiki.org/wiki/Manual:Configuring_file_uploads
 * http://www.mediawiki.org/wiki/Manual:Image_Administration

$wgEnableUploads      = true; $wgFileExtensions[]   = "svg"; $wgAllowExternalImages = true; MediaWiki supports SVG image rendering automatically be rendered as a PNG file. Direct SVG display is not supported in MediaWiki by default, unless you install NativeSvgHandler extension

User rights

 * http://www.mediawiki.org/wiki/Manual:User_rights
 * http://www.mediawiki.org/wiki/Manual:Preventing_access

$wgGroupPermissions['*']['createaccount'] = false;  # restrict account creation $wgGroupPermissions['*']['edit']         = false;   # restrict anonymous editing $wgEnableEmail                           = true; New users will still be able to be created, but only by WikiAdmin Special:Userlogin
 * ToDo: http://www.mediawiki.org/wiki/Manual:$wgSMTP
 * ToDo: $wgRightsUrl, $wgRightsText, $wgRightsIcon

robots.txt

 * http://www.mediawiki.org/wiki/Manual:Robots.txt
 * http://www.mediawiki.org/wiki/Manual:Short_URL

User-agent: * Disallow: /mediawiki/ Disallow: /wiki/Special:Search Disallow: /wiki/Special:Random Be careful, (without  at the end) you'll block access to the /mediawiki'' directory, and search engines will drop your wiki

Sitemap
$ php /opt/mediawiki/maintenance/generateSitemap.php --server= http://alice.saske.sk --urlpath= http://alice.saske.sk --fspath=/var/www/html/ $ ln -s /var/www/html/sitemap-index-alice_wiki.xml /var/www/html/sitemap-index.xml
 * http://www.mediawiki.org/wiki/Manual:GenerateSitemap.php
 * http://www.mediawiki.org/wiki/Extension:ManualSitemap

Privacy policy and Disclaimers
set the content of this pages (as WikiAdmin) to a single hyphen [-]
 * /wiki/MediaWiki:Privacy
 * /wiki/MediaWiki:Disclaimers

Extensions

 * Special:Version
 * http://localhost/wiki/Special:Version
 * http://www.mediawiki.org/wiki/Special:Version

Math

 * http://www.mediawiki.org/wiki/Extension:Math
 * http://www.mediawiki.org/wiki/Manual:Enable_TeX

$ cd /opt/mediawiki/extensions $ git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Math.git Math extension needs dvipng and cancel packages from TeX Live and symbolic links on and  in  $ ln -s /opt/texlive/201*/bin/x86_64-linux/latex /usr/bin/ $ ln -s /opt/texlive/201*/bin/x86_64-linux/dvipng /usr/bin/ $ ln -s /opt/texlive/201*/bin/x86_64-linux/dvips /usr/bin/ $ yum install ocaml $ cd Math/math $ make                # produce  executable file

require_once("extensions/Math/Math.php"); $wgUseMathJax = true; $wgDefaultUserOptions['math'] = MW_MATH_MATHJAX; // setting MathJax as default rendering option for all users

$ php maintenance/update.php

SimpleMathJax

 * http://www.mediawiki.org/wiki/Extension:SimpleMathJax

MathJax

 * http://www.mediawiki.org/wiki/Extension:MathJax
 * http://people.cs.kuleuven.be/~dirk.nuyens/Extension_MathJax/

require_once "$IP/extensions/MathJax/MathJax.php"; $wgParserCacheType = CACHE_NONE; MathJax_Parser::$do_dollar = false; MathJax_Parser::$do_dollardollar = false;

Collection

 * http://www.mediawiki.org/wiki/Extension:Collection

$ yum install php-pear-Net-Curl $ cd /opt/mediawiki/extensions $ git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Collection.git

$wgCollectionFormats = array(    'rl' => 'PDF',     'odf' => 'ODT', ); see README.txt for instructions

Others

 * http://www.mediawiki.org/wiki/Extension:ParserFunctions
 * http://www.mediawiki.org/wiki/Extension:Variables
 * http://www.mediawiki.org/wiki/Extension:Cite
 * http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi
 * http://www.mediawiki.org/wiki/Extension:Collection
 * http://www.mediawiki.org/wiki/Extension:NativeSvgHandler
 * http://www.mediawiki.org/wiki/Extension:CollapsibleVector

git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/ParserFunctions.git git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Variables.git git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Cite.git git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/SyntaxHighlight_GeSHi.git git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Collection.git

require_once "$IP/extensions/Cite/Cite.php"; require_once "$IP/extensions/Collection/Collection.php"; require_once "$IP/extensions/MathJax/MathJax.php"; require_once "$IP/extensions/ParserFunctions/ParserFunctions.php"; require_once "$IP/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php"; require_once "$IP/extensions/Variables/Variables.php"; require_once "$IP/extensions/GistHub/GistHub.php"; require_once "$IP/extensions/GistIt/GistIt.php";
 * 1) require_once "$IP/extensions/Math/Math.php";

  wget https://raw.github.com/gist/2370651/GistHub.php -P /opt/mediawiki/extensions/GistHub/
 * http://gist-it.appspot.com/
 * http://gist-it.sudarmuthu.com/
 * https://gist.github.com/2370651
 * http://www.mediawiki.org/wiki/Extension:GitHub

require_once("extensions/GistHub/GistHub.php");