Skip to content

Latest commit

 

History

History
242 lines (183 loc) · 8.79 KB

README.mediawiki

File metadata and controls

242 lines (183 loc) · 8.79 KB

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.

Installing via Docker

Mediawiki4Intranet requires a lot of additional system software, so the simplest way to install it is by using a Docker script.

Take it from here: https://github.com/mediawiki4intranet/docker

There is a README

Manual Installation

System Requirements

Minimal requirements:

  • PHP 5.3 or later (PHP 7 is supported).
  • Web server: nginx + php_fpm is the best. You may use Apache if you want.
  • MySQL/MariaDB >= 5.1 or PostgreSQL >= 9.0.
  • Debian Linux is preferred.
  • You may use any other Linux distro or FreeBSD, but it's harder to install all required software there.
  • Other UNIX-like OSes or Windows may also work, but with problems.
PHP extensions:
  • php-mysqlnd / php-pgsql for interaction with the database (mysql / postgresql)
  • php-gd
  • php-curl for uploading files via URL.
  • PHP opcode cacher (APC, XCache, ZendOpCache) is highly recommended
  • Under PHP < 5.6, php5-fss for faster string operations
  • Mail and Net_SMTP PEAR packages for e-mail.
PHP configuration (php.ini):
  • post_max_size, upload_max_filesize = 128M or more
  • If your PHP is < 5.3: short_open_tag = Off
  • If your PHP is < 5.4: magic_quotes_gpc = Off
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 zip unzip poppler-utils \
    netpbm librsvg2-bin djvulibre-bin texlive-base texlive-extra-utils ffmpeg \
    dia graphviz gnuplot plotutils umlet default-jre diffutils imagemagick sphinxsearch \
    nginx php7.0-fpm php7.0-cli php7.0-json php7.0-opcache php7.0-mbstring php7.0-curl php7.0-gd \
    php7.0-intl php7.0-mysql php7.0-xml php7.0-zip php-imagick php-apcu php-apcu-bc php-mail php-net-smtp

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 ro

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://[email protected] 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

There is an older Windows bundle of Mediawiki4Intranet which is rarely updated and does not include all the latest features, but you can also try it under Windows.

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.

Warning: do NOT use this bundle for production. Consider Docker image instead.

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.