Manual:Running MediaWiki on FreeBSD

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
Instructions tested on FreeBSD 10.1 with the newest[] packages.

Install the typical database server for MediaWiki pkg install mysql55-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

Create an account for administrate the MySQL mysqladmin -u choose-name-of-admin-account-for-mysql-here password "choose-a-secure-password-for-the-admin-account-for-mysql" ; history -c

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 $EDITOR /usr/local/etc/apache24/httpd.conf DocumentRoot "/usr/local/www/mediawiki"  Options Indexes FollowSymLinks DirectoryIndex index.php index.html AllowOverride None Order allow,deny Allow from all 
 * 1) DocumentRoot "/usr/local/www/apache24/data"

Install the module for the web server Apache (2.4) to handle PHP pkg install mod_php5 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  DirectoryIndex index.php index.html AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps 

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
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 search mediawiki

Instructions tested on FreeBSD 10.1 with the newest[] packages. pkg install mediawiki124

Install additional packages for full support of default MediaWiki
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

SVG support
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.