Manual:Installing MediaWiki on Solaris 11.3

In Solaris most of the applications run separately in Solaris containers or zones. This document will help you step by step to setup your own MediaWiki server in a non-global zone (mediawiki) of Solaris 11.3. This document will not cover the installation of Solaris 11.3 and the installation of a zone.

Zone login
''# zoneadm list global mediawiki'' Login to the non-global zone mediawiki with zlogin:

# zlogin mediawiki

Installation additional software packages
In order to be able to install a MediaWiki server you will have to install these 3 packages: apache, mysql and php in the non-global zone mediawiki:

''# pkg install apache-24 # pkg install php-56 # pkg install mysql-56

Check if both mysql and apache SMF service are disabled:

# svcs svc:/application/database/mysql:version_56 disabled      -             18:42:04         - svc:/application/database/mysql:version_56

# svcs svc:/network/http:apache24 disabled      -             18:29:40         - svc:/network/http:apache24

mysql root password
Before you can use mysql you will have to create a password for the root user:

# cd /usr/mysql/5.6/bin # ./mysqld -u root --password= 

# svcs -av | grep mysql online        -             18:47:14       870 svc:/application/database/mysql:version_56

Configure Apache server
When your mysql SMF service is online, you can start to configure your apache2 webserver. The httpd.conf file is the main configuration file to configure your apache2 webserver. The httpd.conf is located in the /etc/apache2/2.4 directory. In order to fill in the ip address of your MediaWiki non-global zone insert its ip address after ServerName. By default the localhost or 127.0.0.1 will be filled in.

# vi httpd.conf

# ServerName 127.0.0.1
 * 1) If your host doesn't have a registered DNS name, enter its IP address here.

The httpd.conf also contains the web document root directory location. The directory out of which you will serve your documents. Later on, you will have to copy the MediaWiki server files to this location. By default this DocumentRoot directory is /var/apache2/2.4/htdocs.

''DocumentRoot "/var/apache2/2.4/htdocs" 

Enable PHP extensions
When your apache webserver httpd.conf file is configured, you can configure php and enable the necessary extensions (openssl, mbstring) for php and MediaWiki.

# cd /etc/apache2/2.4/samples-conf.d # cp php5.6.conf /etc/apache2/2.4/conf.d/php5.6.conf

To enable PHP extensions, uncomment the desired lines in the extensions.ini file for openssl.so and mbstring.so.

''# cd /etc/php/5.6/conf.d
 * 1) vi extensions.ini

;extension=ldap.so extension=mbstring.so ;extension=mysql.so ;extension=mysqli.so ;extension=opcache.so extension=openssl.so ;extension=pcntl.so''

If you want to verify if your php has been successfully configured in the Apache server, you can check the link to this document: https://www.mediawiki.org/wiki/How_to_verify_installed_php_version_in_Solaris_11.3_and_in_Apache_webserver

Download MediaWiki software
You can download the MediaWiki resources at the download page of the MediaWiki website: https://www.mediawiki.org/wiki/Download The mediawiki-1.30.0.tar.gz file can then be unpacked and copied into /var/apache2/2.4/htdocs (DocumentRoot Apache server).

In the global zone:

# cp /mediawiki-1.30.0.tar.gz /rpool/ROOT/var/apache2/2.4/mediawiki-1.30.0.tar.gz

In the non-global zone:

# cd /var/apache2/2.4 # mv htdocs htdocs_apache # gunzip mediawiki-1.30.0.tar.gz # tar xvf mediawiki-1.30.0.tar # mv mediawiki-1.30.0 /var/apache2/2.4/htdocs

When the unpacking is done of the MediaWiki media, you can enable the apache SMF service:

# svcadm enable svc:/network/http:apache24

# svcs -av | grep apache online        -             19:40:58       879 svc:/network/http:apache24

Initial Mediawiki installation
Before installing the MediaWiki server via the browser you need to create the data directory in /var/apache2/2.4: # mkdir /var/apache2/2.4/data # chgrp webservd data /var/apache2/2.4/data # chmod g+w /var/apache2/2.4/data

If you now open your browser and fill in the ip address of your non-global zone, you will see the MediaWiki server first page and you can start the installation by clicking set up the wiki:



After the installation a LocalSetting.php file will be created. You will need to download the LocalSetting.php file and copy it to the DocumentRoot of your apache server. In this case this will be /var/apache2/2.4/htdocs.

After disabling/enabling the apache24 SMF service in your non-global zone mediawiki, you can start using your MediaWiki server:

# svcadm disable apache24 # svcadm enable apache24

JefAdams (talk) 16:23, 12 March 2018 (UTC)