/configs

Configuration and deployment script repository

Primary LanguagePHP

You may also read this page at:

Table of Contents

Mediawiki4Intranet

Mediawiki4Intranet is a MediaWiki distribution containing many extensions and patches useful for intranet (and not only for intranet) usage. It is also important that mostly all of these extensions are improved and tested to work together — integration bugs are fixed and some new features are added.

System Requirements

Minimal requirements:

  • PHP 5.2 or later. 5.3 or later is recommended.
  • Web server. The simplest is to use Apache, nginx with php_fpm also works, IIS and others are also supported in theory.
  • MySQL DBMS version 5 or later.
  • UNIX-like system is preferred.
PHP extensions:
  • php5-mysql or php5-mysqli for interaction with the database.
  • php5-gd for images.
  • php5-curl for uploading files via URL.
PHP configuration (php.ini):
  • error_reporting = E_ALL & ~E_NOTICE
  • If your PHP is < 5.3: short_open_tag = Off
  • magic_quotes_gpc = Off (should be Off on every web server which respects itself)
  • For SUPA screenshot upload: either disabled Suhosin, or suhosin.post.max_value_length = 8000000 and suhosin.request.max_value_length = 8000000. 8000000 is an example, you can set a bigger value.
Optional PHP extensions:
  • PHP opcode cacher, like APC or XCache for overall performance.
  • php5-fss for faster string operations.
  • Mail and Net_SMTP PEAR packages for e-mail.
A lot of third-party software is also required for different extensions to work; GNU/Linux users may usually 'apt-get' them, and Windows users may use our standalone bundle (see below).

If you're on Debian or Ubuntu GNU/Linux distribution, simply run:

apt-get install php5 php5-mysql php5-gd php5-curl php5-apc php-mail php-net-smtp \
	texlive-base djvulibre-bin netpbm ghostscript poppler-utils \
	ffmpeg graphviz gnuplot openjdk-6-jre sphinxsearch zip unzip umlet

After running this command, the only software which must be installed manually will be:

Downloaded tika-app.jar should be put to system auto-start (for example /etc/rc.local), with the following arguments:

java -jar tika-app-1.2-fix-TIKA709-TIKA964.jar -p 127.0.0.1:8072 -t -eutf-8

Installation

First of all, you need to install the software listed in System Requirements.

Then, clone index repository:

git clone --depth=1 https://github.com/mediawiki4intranet/configs.git mediawiki/configs

Run repo.php to fetch the code with all extensions:

php mediawiki/configs/repo.php install mediawiki4intranet

Create images subdirectory and grant web-server read-write access into it:

mkdir mediawiki/images
chown www-data:www-data mediawiki/images

Create an empty MySQL database and user for MediaWiki:

mysql -u root -p <<EOF
	CREATE DATABASE mediawiki;
	GRANT ALL PRIVILEGES ON mediawiki.* TO mediawiki@localhost IDENTIFIED BY 'mediawiki';
	FLUSH PRIVILEGES;
EOF

Create minimal mediawiki/LocalSettings.php including predefined configuration:

<?php

require_once 'configs/ServerSettings.php'; # use this under UNIX, or BaseSettings.php under Windows

$wgDBname = 'mediawiki'; # database name
$wgDBuser = 'mediawiki'; # login and password for database user
$wgDBpassword = 'mediawiki';
$wgDBadminuser = $wgDBuser;
$wgDBadminpassword = $wgDBpassword;
$wgScriptPath = '/mediawiki';

Initialise database:

cd mediawiki
php maintenance/patchSql.php maintenance/tables.sql
php maintenance/update.php

Optionally configure Sphinx search (careful, do not overwrite your existing config if you have one):

cd mediawiki
php configs/maintenance/configure-sphinx.php --localsettings LocalSettings.php
mv sphinx.conf /etc/sphinxsearch
service sphinxsearch restart
cat >> LocalSettings.php <<EOF
	
	require_once "$IP/extensions/SphinxSearchEngine/SphinxSearchEngine.php";
	$wgSphinxQL_index = 'wiki';
EOF
php extensions/SphinxSearchEngine/rebuild-sphinx.php

At this point you're done and have a working Mediawiki4Intranet installation, with all included extensions and patches.

Using read-write clones

If you have commit access and want to participate in development, use read-write installation instead of read-only:

git clone https://github.com/mediawiki4intranet/configs.git mediawiki/configs
php mediawiki/configs/repo.php install mediawiki4intranet rw

Then develop as usual, and after push'ing to any extension or core, just run the following inside your 'configs' working copy:

php repo.php update
git push

CAUTION: Since recently, repo.php doesn't use different URLs for read-only and read-write clones. So, to push to github via ssh, use the built-in Git feature:

git config --global url.ssh://git@github.com.pushinsteadof https://github.com

Creating your own bundle

To create your own bundle, fork this repository, clone it or switch your existing 'configs' working copy to it (it must be cloned as read-write), and then use the inclusion feature of repo.php:

Create your own 'my-super-bundle.ini' in your 'configs' working copy using the following template:

[_params]
include[] = mediawiki4intranet

;; Optionally add your own repository url prefixes:
;prefix.my-server = git:http://my.site/git/$REPO.git

; And add some extensions like this:
[extensions/MyExtension]
repo = my-server:MyExtension
;; You may override the checked out branch using:
;branch = master

;; Or remove extensions like this:
;[extensions/Wikilog]
;repo =

Then run:

php repo.php install my-super-bundle rw
git add my-super-bundle.ini my-super-bundle-index.ini
git commit -m "Created a fork of MediaWiki4Intranet bundle with my own extension!"
git push

As you already may have noticed, this doesn't change any files of our distribution, so the resulting repository will be very easy to merge with newer versions of ours.

Standalone Windows bundle

As the simplest way to try Mediawiki4Intranet for Must-Die systems (M$ Window$) we have a standalone bundle which is rarely updated and may not include all the latest features, but does include all the software needed to run Mediawiki4Intranet.

Just download it, unpack to D:\wiki4intranet\, run D:\wiki4intranet\xampp-control.exe, start Apache and MySQL via clicking "Start" buttons, and point your browser to http://localhost/wiki/, and login with WikiSysop/Wiki4IntraNet login/password.

It is NOT recommended to use this bundle for production as it IS NOT properly and securely configured, not to speak of that it runs on a bad operating system made by bad company with bad policies. :)

Use it only if you want to have Mediawiki4Intranet on your local machine with that OS.

repo.php TODO

MAYBE:

  • Setup remotes for additional repositories of the same module (i.e. wikimedia for our forks)
  • Support automatic calling maintenance/update.php for DB updates
  • Support 'soft update' for the case of added extensions:
    • First update configs dir except *Settings.php
    • Then update the code, then update *Settings.php so missing extension files do not crash the live site.
    But maybe it's a bad idea just because updating the live site is a bad idea itself.