Running MediaWiki on Sabayon

30 August 2015 HOWTOs, Installation guides, Wiki applications No comments

MediaWiki (MW) is a free wiki application that powers several notable websites including all the Wikimedia Projects (e.g., Wikimedia Commons and Wikipedia), Wikia sites, Orain Wiki sites, ShoutWiki sites and even the Gentoo and Sabayon Wiki websites. It is written in PHP and also requires a web server (usually Apache) and a backend database (usually MariaDB or MySQL) configured to use it, in order for one to be able to run it. On Sabayon there are a few different ways to run MediaWiki, which mostly just vary by the server or database used to host the Wiki.


This basic method can be boiled down to the following steps:

      1. Add PHP USE flags to all packages using:
        root #  euse php
      2. Run:
        root #  echo “dev-lang/php apache2 xmlreader” >> “/etc/portage/package.use/gentoo.use”
      3. Note: the following step while written for MariaDB, can be easily adjusted to using a MySQL backend database, simply substitute mariadb in these following commands with mysql.Install LAMP and configure MariaDB. To do this with Portage (emerge) run:
        root #  emerge -a dev-db/mariadb virtual/httpd-php www-servers/apache
        root #  emerge –config dev-db/mariadb
        root # equo rescue spmsync && equo mask dev-db/mariadb virtual/httpd-php www-servers/apache

        whereas to do this with Entropy (equo) run:

        root #  equo i dev-db/mariadb virtual/httpd-php www-servers/apache
        root #  equo config dev-db/mariadb

        Optionally one can run, after installing LAMP and configuring MariaDB, the following:

        root #  mysql_secure_installation
      4. Add:

        to /etc/conf.d/apache2.
      5. Edit your php.ini file, which should be somewhere in a subdirectory of /etc/php with apache2 in its name, e.g., /etc/php/apache2-php5.6. Find the following lines and uncomment them (removing the semicolon, ; from before them).

        the last line can be left commented if using a MySQL database.
      6. Enable the apache2 and mysqld daemons and start them.
        root #  systemctl enable apache2 && systemctl start apache2
        root #  systemctl enable mysqld && systemctl start mysqld
      7. Download and extract the source code of the MediaWiki release you want to /var/www/localhost/htdocs/ and change the permissions of the files therein accordingly, for example:
        root #  wget -c
        root #  tar -xzf mediawiki-1.25.2.tar.gz -C /var/www/localhost/htdocs/
        root #  cd /var/www/localhost/htdocs/
        root #  mv mediawiki-1.25.2 w
        root #  chmod 777 -R w
        root #  chown apache:apache -R w

        I am aware of the www-apps/mediawiki package in Gentoo and Sabayon main repositories, but for me they never seem to work.

      8. Open up your browser to http://localhost/w/mw-config and run the set up script. To do this from the command-line, for example (and this will open up your default web browser), run:
        user $  xdg-open http://localhost/w/mw-config

        Then when you are finished, download LocalSettings.php to /var/www/localhost/htdocs/w and open your web browser to http://localhost/w/index.php/Main_Page.

Optional configuration

Short Wiki URL

  • To get your Wiki to use a shorter URL, namely http://localhost/wiki/$1 instead of what it would be using if set up with the aforementioned method, http://localhost/w/index.php/$1, add the following to /etc/apache2/vhosts.d/default_vhost.include:

    and the following to LocalSettings.php:

    External links


29 August 2015 Uncategorized No comments

I come from a science (specifically mathematics and medicine) background and I am fairly new to Sabayon Linux and started using it in June 2015, but ever since I tried I have ranked it within my top three favourite Linux distributions, along with Manjaro Linux and Ubuntu. This blog is on Sabayon Linux and my experiences with it.

To those of you that may not be familiar with Sabayon here are some of the most important/distinctive features of this distribution:

  • Accessibility and development: free and developed by an international community of volunteers. Originally created by the Italian software engineer, Fabio Erculiani.
  • Origin: Gentoo-based with a file system structure similar to its parent and it includes the Portage package manager, along with several other utilities. It also follows a rolling release model like its parent.
  • Out of the box: it is designed to be able to be used as is, without any further configuration or installation of software.
  • Package management: able to use Portage and its own (specifically built by Erculiani for Sabayon) binary package management system, Entropy.
  • Target demographic: semi-newcomers to Linux. By “semi-newcomers” it is meant that it is not quite as beginner-friendly as Ubuntu, for instance, but it is more user-friendly than some of the distributions oriented towards experienced users such as Arch Linux, Gentoo Linux and Slackware, hence it is probably best tailored for users that have some experience (to the point of being comfortable with using them) with newcomer distributions like Ubuntu, that are willing to try a slightly more challenging and customizable distribution.