The mediawiki in Ubuntu 16.04 is removed on 2016/8. Newer mediawiki is added in Ubuntu 16.10. This article will describe porting newer mediawiki from Ubuntu 16.10 to Ubuntu 16.04.
Table of Contents
1 Install mediawiki
Install devscripts with apt.
$ sudo apt install -y devscripts
Download mediawiki source code in Ubuntu 16.10. Since the version of mediawiki may change due to the update of Ubuntu, check here and change VERSION and RELEASE.
$ MEDIAWIKI=http://archive.ubuntu.com/ubuntu/pool/universe/m/mediawiki $ VERSION=1.27.1 $ RELEASE=3 $ mkdir mediawiki $ cd mediawiki/ $ wget -q ${MEDIAWIKI}/mediawiki_${VERSION}-${RELEASE}.debian.tar.xz $ wget -q ${MEDIAWIKI}/mediawiki_${VERSION}-${RELEASE}.dsc $ wget -q ${MEDIAWIKI}/mediawiki_${VERSION}-${RELEASE}_all.deb $ wget -q ${MEDIAWIKI}/mediawiki_${VERSION}.orig.tar.gz
Extract source code.
$ tar zxf mediawiki_${VERSION}.orig.tar.gz $ cd mediawiki-${VERSION}/ $ tar xf ../mediawiki_${VERSION}-${RELEASE}.debian.tar.xz
Install packages for building mediawiki.
$ sudo apt install -y `dpkg-checkbuilddeps 2>&1 | \ sed -e 's/.*build dependencies://g' -e 's/([^)]*)//g'`
Change PHP5 to PHP7 in devscript.
$ sed -i -e 's/php5enmod/phpenmod/g' debian/mediawiki.postinst $ sed -i -e 's/php5dismod/phpdismod/g' debian/mediawiki.prerm $ sed -i -e 's:etc/php5:etc/php/7.0:g' debian/mediawiki.install $ sed -i -e 's/mods_php5/mods_php7.0/g' debian/etc/mediawiki.conf
Build mediawiki source code.
$ dpkg-buildpackage -us -uc
Install mediawiki deb file with installing depends package.
$ sudo apt install -y php-common $ sudo dpkg -i ../*.deb || (sudo apt install -f -y && sudo dpkg -i ../*.deb)
Install packages required by mediawiki.
$ sudo apt install -y libapache2-mod-php7.0 php7.0-xml imagemagick git $ sudo systemctl retart apache2
2 Install MySQL
Install mysql-server with apt.
$ sudo apt install -y mysql-server
Input MySQL password.
Confirm MySQL password.
3 Access to MediaWiki
Access the following URL with browser.
http://<server>/mediawiki
Click "set up the wiki".
Select language.
Improvements about mediawiki are displayed.
Select MySQL and input MySQL password.
Use default database setting.
Input Wiki name and add admin user.
Select access control list to Wiki. This article will use "Authorized editors only" which allow authorized user to write and allow public user to read.
Start installation.
The installation is completed.
Download LocalSetting.php and copy to /etc/mediawiki manually.
$ sudo mv LocalSettings.php /etc/mediawiki/
Accessing the previous URL with browser will display Main page.