From StrelaWiki
Jump to navigation Jump to search


$ cd /opt/
$ git clone mediawiki
$ cd mediawiki
$ git clone
$ cd skins
$ git clone

$ git checkout <branchname OR tag name>
$ git checkout master   # default
$ git checkout 1.18.2   # tag for current (2012-04) version

$ wget -P /etc/httpd/conf.d/
$ systemctl restart httpd.service

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: <sql_root_passwd>
Database settings
Use the same account as for installation [uncheck]
Database username: wikiuser
Database password: <sql_wiki_passwd>
Create the account if it does not already exist [check]
Storage engine: InnoDB
Database character set: Binary
Settings will be saved in LocalSettings.php file
Name of wiki: StrelaWiki
Project namespace: Other (specify): StrelaWiki
Administrator account
Your name: WikiAdmin
Password: <wiki_admin_passwd>
E-mail address:
Ask me more question [check]
Settings will be saved in strela_wiki MySQL database (which will be created soon)
User rights profile: Authorized editors only
Settings will be later changed in LocalSettings.php file
Only now MediaWiki installer create strela_wiki MySQL database and LocalSettings.php file


Save and move generated file LocalSettings.php to the main wiki directory /opt/mediawiki/

$ mv /home/musinsky/LocalSettings.php /opt/mediawiki/
$ chmod 600 /opt/mediawiki/LocalSettings.php
$ chown apache:apache /opt/mediawiki/LocalSettings.php

Delete the /opt/mediawiki/mw-config/ directory


$ cd /opt/mediawiki/
$ git pull
$ php maintenance/update.php


Backup MediaWiki (MySQL database + images + LocalSettings.php + others) script Execute as root user (needed permissions to read LocalSettings.php file)

$ wget


Ensure that your "fresh install" consists of the same version of MediaWiki

  1. Backup Backup the database and MediaWiki files
  2. Install Re-create the database, user and permissions
    • create database username: wikiuser with database password: 'sql_wiki_passwd'
    • create database name: strela_wiki with all privileges for wikiuser
  3. Move
    1. Modify (created file) / copy (previous wiki settings) file LocalSettings.php
      $ chmod 600 LocalSettings.php; chown apache:apache LocalSettings.php
    2. Import the MediaWiki files (copy all MediaWiki files, images/math, images/thumb, images/tmp)
      $ chown -R apache:apache images/; chmod -R 755 images/
    3. Import the database backup
      $ mysql --user=wikiuser --password strela_wiki < strela_wiki-dump_YYYY-MM-DD.sql
    4. Update the database
      $ php /opt/mediawiki/maintenance/update.php
  • ToDo
$ 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.


The LocalSettings.php file provides local configuration settings (based on the DefaultSettings.php file) of a MediaWiki.

$wgServer               = "";
$wgLogo                 = "$wgScriptPath/images/strela_logo.png";
$wgFavicon              = "$wgScriptPath/images/strela_icon.png";
$wgShowExceptionDetails = true;

Short URL

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


File uploads

Uploaded files will be distributed into sub-directories of $wgUploadDirectory (/opt/mediawiki/images/) based on the first two characters of the md5 hash of the filename ($IP/images/a/ab/foo.jpg). If $wgHashedUploadDirectory is false, all images are uploaded in $wgUploadDirectory itself ($IP/images/foo.jpg)

$ chown -R apache:apache /opt/mediawiki/images/
$ chmod -R 755 /opt/mediawiki/images/
$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

$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



User-agent: *
Disallow: /mediawiki/
Disallow: /wiki/Special:Search
Disallow: /wiki/Special:Random

Be careful, Disallow: /mediawiki (without '/' at the end) you'll block access to the /mediawiki directory, and search engines will drop your wiki


$ php /opt/mediawiki/maintenance/generateSitemap.php --server= --urlpath= --fspath=/var/www/html/
$ ln -s /var/www/html/sitemap-index-alice_wiki.xml /var/www/html/sitemap-index.xml

Privacy policy and Disclaimers

set the content of this pages (as WikiAdmin) to a single hyphen [-]



$ cd /opt/mediawiki/extensions
$ git clone

Math extension needs dvipng and cancel packages from TeX Live and symbolic links on latex and dvipng in /usr/bin/

$ 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 texvc executable file
$wgUseMathJax = true;
$wgDefaultUserOptions['math'] = MW_MATH_MATHJAX; // setting MathJax as default rendering option for all users
$ php maintenance/update.php



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


$ yum install php-pear-Net-Curl
$ cd /opt/mediawiki/extensions
$ git clone
$wgCollectionFormats = array(
    'rl' => 'PDF',
    'odf' => 'ODT',

see README.txt for instructions


git clone
git clone
git clone
git clone
git clone
require_once "$IP/extensions/Cite/Cite.php";
require_once "$IP/extensions/Collection/Collection.php";
#require_once "$IP/extensions/Math/Math.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";

wget -P /opt/mediawiki/extensions/GistHub/