Manual:Running MediaWiki on FreeBSD

From MediaWiki.org
Jump to: navigation, search
Installation guidesManual:Installation guide
FreeBSDManual:Running MediaWiki on FreeBSD
GNU/LinuxManual:Running MediaWiki on GNU/Linux
- ALT LinuxManual:Running MediaWiki on ALT Linux
- Arch LinuxManual:Running MediaWiki on Arch Linux
- DamnsmalllinuxManual:Running MediaWiki on Damnsmalllinux
- Debian or UbuntuManual:Running MediaWiki on Debian or Ubuntu
- FedoraManual:Running MediaWiki on Fedora
- GentooManual:Running MediaWiki on Gentoo Linux
- MandrivaManual:Running MediaWiki on Mandriva
- Red Hat Enterprise LinuxManual:Running MediaWiki on Red Hat Linux
- SlackwareManual:Running MediaWiki on Slackware Linux
Mac OS XManual:Running MediaWiki on Mac OS X
NetWareManual:Running MediaWiki on NetWare
SolarisManual:Running MediaWiki on Solaris
- Solaris 11 / opensolarisManual:Running MediaWiki on Solaris 11 / opensolaris
- Solaris 10Manual:Running MediaWiki on Solaris 10
WindowsManual:Running MediaWiki on Windows
- Windows Server 2016Manual:Installing MediaWiki on Windows Server 2016
on a stickManual:Wiki on a stick
- Uniform ServerManual:Installation on Uniform Server (Windows)
- XAMPPManual:Installing MediaWiki on XAMPP
Sourceforge.netManual:Installing MediaWiki on SourceForge.net

This installation guide assumes you are installing on the local machine (localhost) and that you are logged in as the superuser (root).

Set up the requirements[edit]

Instructions tested on FreeBSD 10.1 with the newest[2014-12-18] packages for mediawiki124. mediawiki123 (LTS) was also tested.

Install the typical database server for MediaWiki

pkg install mysql56-server

Edit the config file of system environment (for booting next time) for MySQL

$EDITOR /etc/rc.conf
mysql_enable="YES"

Start MySQL as the database server

/usr/local/etc/rc.d/mysql-server onestart

Secure the MySQL installation

/usr/local/bin/mysql_secure_installation

Install the typical web server Apache (2.4)

pkg install apache24

Edit the config file of system environment (for booting next time) for Apache (2.4)

$EDITOR /etc/rc.conf
apache24_enable="YES"

Edit the config file of the web server Apache (2.4) to find MediaWiki (for apache24 if you have *[authz_core:error] AH01630* at apache error_log, please remamber for APACHE24 use at conf - *Require all granted* instead lanes ORDER ALLOW, DENY ALLOW FROM ALL http://httpd.apache.org/docs/2.4/upgrading.html)

$EDITOR /usr/local/etc/apache24/httpd.conf
#DocumentRoot "/usr/local/www/apache24/data"
DocumentRoot "/usr/local/www/mediawiki"
<Directory "/usr/local/www/mediawiki">
        Options Indexes FollowSymLinks
        DirectoryIndex index.php
        AllowOverride None
        Require all granted
</Directory>

Install the module for the web server Apache (2.4) to handle PHP

pkg install mod_php56

By installing this package there will be a line added to the config file of the web server Apache (2.4).

Check the entry for the module php5_module
cat /usr/local/etc/apache24/httpd.conf | grep php5_module
LoadModule php5_module  libexec/apache24/libphp5.so

Edit the config file of the web server Apache (2.4) to handle PHP

$EDITOR /usr/local/etc/apache24/httpd.conf
<IfModule php5_module>
        DirectoryIndex index.php index.html
        AddType application/x-httpd-php .php
        AddType application/x-httpd-php-source .phps
</IfModule>

Please check that you set up your hostname at the config file of system environment (for booting next time).

cat /etc/rc.conf | grep hostname
hostname="wiki.your-domain.tld"
If it is not set you might add it to the config file of system environment (for booting next time).
$EDITOR /etc/rc.conf

Install MediaWiki[edit]

For experienced users, here is the quick version of the installation instructions. Most users will want to go through all the passages.

  1. Check that your system meets the minimum requirements shown nearby; Installation requirements has more details.
  2. Download MediaWiki (direct link to download the stable release version) and extract the archive to a web-accessible folder on your server.
  3. Point your browser to the directory where MediaWiki was extracted and follow the link to the setup screen. It should be in the form http://domain/directory/mw-config/index.php. Replace directory with the path to your extracted MediaWiki folder. If installing on a local machine, replace domain with localhost. If you install locally and later want to access your wiki from domain, then you will need to change LocalSettings.php from localhost to domain. If installed on a remote server, replace domain with your server's domain name (eg: www.myserver.com).
  4. Follow the on-screen instructions to complete the process.

These instructions are deliberately brief. There is a lot that could go wrong, so if in doubt, you are advised to read the full instructions!



Otherwise you can install MediaWiki with the packages provided by FreeBSD directly.

There are several versions of MediaWiki available at FreeBSD. Which are available at present, you can check via pkg.

pkg search mediawiki

Instructions tested on FreeBSD 10.3

pkg install mediawiki127

Install additional packages for full support of default MediaWiki[edit]

Install the version control system git

pkg install git

Install additional package to support languages for PHP

pkg install pecl-intl

Install additional package to handle displaying pictures for PHP

pkg install pecl-imagick

Install additional package to can caching for PHP

pkg install pecl-APC

You also need a cypher library for secure storage (mcrypt works too but is deprecated in PHP 7.1 and will be removed in PHP 7.2):

pkg install php56-openssl

Replace php56- by the PHP version you want, for example php70- or php71- (not yet available at writing time).

SVG support[edit]

Add the following lines to LocalSettings.php to allow SVG upload and to enable thumbnail and preview rendering with Inkscape:

 $wgFileExtensions = array('png', 'gif', 'jpg', 'jpeg', 'svg');
 $wgSVGConverters = array(
   'Inkscape' => '/usr/local/bin/inkscape -z -w $width -f $input -e $output',);
 $wgSVGConverter = 'Inkscape';

Obviously, Inkscape must be installed for this to work (pkg_add -r inkscape). Wikipedia is still using rsvg for SVG rendering, which produces less accurate results than Inkscape but is faster.[1]

See also[edit]

References[edit]

Language:Project:Language policy English  • 日本語