Manual:Running MediaWiki on Solaris 10

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
Wikimedia-logo-meta.png

This page was moved from MetaWiki.
It probably requires cleanup – please feel free to help out. In addition, some links on the page may be red; respective pages might be found at Meta. Remove this template once cleanup is complete.

For Solaris, one can do a native installation. Solaris 10 has "premier support" till January 2018 (OLSP p. 30).

native[edit]

The following are notes on how to enable MediaWiki, PHP, MySQL, and Apache in Solaris 10.

MediaWiki requires a PHP-enabled webserver and MySQL. Stock Solaris 10 comes with Apache and MySQL. PHP is installed from the Solaris Software Companion CD. MediaWiki consists of downloaded PHP scripts that use MySQL. The following details each step.

(Another method: CoolStack from Sun, specifically CSKamp for Apache, MySQL and PHP, and CSKmemcached for memcached.)

MySQL[edit]

MySQL is part of Stock Solaris 10. If not installed, install packages SUNWmysqlr, SUNWmysqlt, and SUNWmysqlu. To enable, see file /etc/sfw/mysql/README.solaris.mysql. Here's what I did:

# /usr/sfw/bin/mysql_install_db
# groupadd mysql
# useradd -g mysql -d /var/mysql mysql
# chgrp -R mysql /var/mysql
# chmod -R 770 /var/mysql

Start:

# /usr/sfw/sbin/mysqld_safe --user=mysql &

Set password:

# /usr/sfw/bin/mysqladmin -u root password pw # <--SET password (don't use root's)

Test:

# cd /usr/sfw/mysql/mysql-test; ./mysql-test-run

Automatic start and stop of mysql daemon at boot and shutdown:

# ln /etc/sfw/mysql/mysql.server /etc/rc3.d/S99mysql
# ln /etc/sfw/mysql/mysql.server /etc/rc0.d/K00mysql
# ln /etc/sfw/mysql/mysql.server /etc/rc1.d/K00mysql
# ln /etc/sfw/mysql/mysql.server /etc/rc2.d/K00mysql
# ln /etc/sfw/mysql/mysql.server /etc/rcS.d/K00mysql

PHP[edit]

Heads up!

When configuring MediaWiki, it complains that you don't have PHP5 installed. (so it would appear that PHP5 will be required, as the 1.7.1 version of MediaWiki doesn't work with PHP4.)

PHP4[edit]

PHP4 is available on the "Solaris Software Companion" CD. It comes with an php-module wich is compatible with apache1. If You want to use PHP5 and Apache2, step over to Section PHP5. Mount the CD and run the installer script that's appropriate for your architecture (x86 or SPARC). PHP is located in the Development/Languages group of packages. After PHP has been installed run the post-install script /opt/sfw/apache/x_postinstall. This will create the file /etc/apache/httpd.conf-php-example which you will need later.

PHP5[edit]

This part is only necessary if you want to use Apache2 and PHP 5 with your installation. In that case you don't need the PHP4 installation. Instead you should download the following packages from www.sunfreeware.com:

libgcc
libiconv
zlib
libxml2
php

Note that the version numbers may change on www.sunfreeware.com, due to updates. The best way to start is to look for an php-5.x.x package and then download the subsequent dependencies. You don't need to download Apache2 and mySQL as Solaris 10 already comes with these packages.

I downloaded them to the directory /tmp/php-packages and installed them:

# cd /tmp/php-packages
# for i in *gz; do gunzip $i; done
# for i in *local ; do pkgadd -d $i; done

Now you have to copy the php-module and php.ini to their approriate directories:

# cp -p /usr/local/apache2/modules/libphp5.so /usr/apache2/libexec
# cp -p /usr/local/php/doc/php/php.ini-recommended  /etc/apache2/php.ini

If you want a phpinfo page (see "Security Considerations" below), create it with:

echo "<?php phpinfo(); ?>" >/var/apache2/htdocs/phpinfo.php

Apache[edit]

Apache 1.3[edit]

If you want to use Apache2 with PHP 5, ignore this Section and see Apache2 chapter below.

Solaris comes with Apache. If you don't have Apache installed, install packages SUNWapachd, SUNWapchr, and SUNWapchu.

To enable Apache, copy /etc/apache/httpd.conf-php-example to /etc/apache/httpd.conf. Edit httpd.conf. At minimum you need to change the "ServerName" line. I also change the "User" and "Group" lines to "User apache" and "Group apache" after adding an apache group and apache user:

# groupadd apache
# useradd -g apache -d /var/apache apache

The web documents live in /var/apache/htdocs.

Start Apache the first time with "/etc/init.d/apache start". See if the httpd process is running, check the error log at /var/apache/logs/error_log, and access with your web browser. On subsequent reboots, Apache will restart automatically if httpd.conf is present.

Verify PHP is enabled by going to http://localhost/phpinfo.php where localhost is the hostname of your system.

Apache2[edit]

If you want to use Apache2, which also comes with Solaris 10, you will have to use the PHP5 module and install it as described above, since the PHP4 module from the "Solaris Software Companion" CD is incompatible with the Apache2 Version.

First copy /etc/apache2/httpd.conf-example to /etc/apache2/httpd.conf. Then edit /etc/apache2/httpd.conf and add the following lines in their appropriate places.

LoadModule php5_module        libexec/libphp5.so
AddType application/x-httpd-php .php

Then start and enable the apache2 service:

# svcadm -v enable /network/http:apache2

If you are told that the argument doesn't match any instances, you need to pkill svc.configd. Details of the problem are at http://forum.sun.com/jive/thread.jspa?threadID=74430&tstart=210

Check if apache is running.

If not do the following as root in zone where wiki is installed

1. check if the service state is enabled and online

# svcs -l http
fmri         svc:/network/http:apache2
name         Apache 2 HTTP server
enabled      false
state        disabled
next_state   none
state_time   Thu Apr 20 15:56:44 2006
restarter    svc:/system/svc/restarter:default
dependency   require_all/error svc:/network/loopback:default (online)
dependency   optional_all/error svc:/network/physical:default (online)

2. enable the service

# svcadm -v enable /network/http:apache2
svc:/network/http:apache2 enabled.

3. check current status

# svcs -l http
fmri         svc:/network/http:apache2
name         Apache 2 HTTP server
enabled      true
state        online
next_state   none
state_time   Thu Apr 20 15:59:02 2006
logfile      /var/svc/log/network-http:apache2.log
restarter    svc:/system/svc/restarter:default
contract_id  2197
dependency   require_all/error svc:/network/loopback:default (online)
dependency   optional_all/error svc:/network/physical:default (online)

4. restart the service

#svcadm restart /network/http:apache2

5. check the process status

# ps -ef |grep http
    root  20530 20047   0 15:59:33 ?           0:00 /usr/apache2/bin/httpd -k start
 webservd 20534 20530   0 15:59:34 ?           0:00 /usr/apache2/bin/httpd -k start
 webservd 20531 20530   0 15:59:34 ?           0:00 /usr/apache2/bin/httpd -k start
 webservd 20532 20530   0 15:59:34 ?           0:00 /usr/apache2/bin/httpd -k start
 webservd 20535 20530   0 15:59:34 ?           0:00 /usr/apache2/bin/httpd -k start
 webservd 20533 20530   0 15:59:34 ?           0:00 /usr/apache2/bin/httpd -k start
    root 20537 20500   0 15:59:39 pts/2       0:00 grep http

Verify PHP is enabled by going to http://localhost/phpinfo.php where localhost is the hostname of your system.

MediaWiki[edit]

There is no Solaris package for MediaWiki. Just download the PHP scripts from Download and follow the installation instructions at http://meta.wikimedia.org/wiki/Help:Installation Untar the files to /var/apache/htdocs/wiki (or /var/apache2/htdocs/wiki when using Apache2) such that you have file /var/apache/htdocs/wiki/index.php (you will need to move the files up a directory level). Then fix permissions as follows:

Apache/PHP4 Version:

 # cd /var/apache/htdocs/wiki
 # chown -R apache:apache *
 # chmod -R o-rwx *
 # chmod -R g+rw config
 

Apache2/PHP5 Version:

 # cd /var/apache2/htdocs/wiki
 # chown -R webservd:webservd *
 # chmod -R o-rwx *
 # chmod -R g+rw config
 

Start the web browser and install and configure from there: http://localhost/wiki/config/ I kept the defaults for the database and sysop and set the password. The sysop and database password may be the same, but don't use root's password (as it's saved in cleartext in LocalSettings.php). After filling out the form click INSTALL. If you are successfully connected to the database, then copy and save the local settings:

Apache/PHP4:

# cd /var/apache/htdocs/wiki
# mv config/LocalSettings.php .
# cp LocalSettings.php LocalSettings.php.original

Apache2/PHP5:

# cd /var/apache2/htdocs/wiki
# mv config/LocalSettings.php .
# cp LocalSettings.php LocalSettings.php.original

I made these customizations to LocalSettings.php:

$wgLogo = "$wgScriptPath/images/logo.jpg";
$wgEnableUploads = true;
$wgEnableUploads  = true;
$wgUseImageResize = true;
$wgUseImageMagick = true;
$wgImageMagickConvertCommand = "/usr/sfw/bin/convert";

Now test by going to the main wiki page: http://localhost/wiki/ (where localhost is your system's hostname)

After customizing, it's a good idea to backup your LocalSettings.php file and dump the database to a safe location:

Apache/PHP4:

# cp /var/apache/htdocs/wiki/LocalSettings.php LocalSettings.php.backup
# /usr/sfw/bin/mysqldump --user=wikiuser --password=YOURPWHERE wikidb |gzip -9 >wiki-mysql-dump.txt.gz

Apache2/PHP5:

# cp /var/apache2/htdocs/wiki/LocalSettings.php LocalSettings.php.backup
# /usr/sfw/bin/mysqldump --user=wikiuser --password=YOURPWHERE wikidb |gzip -9 >wiki-mysql-dump.txt.gz

Security considerations[edit]

Security Considerations

As Apache and MediaWiki is web-facing software, you should consider security, especially if it's on the public Internet. Keeping the software up-to-date is an important part of security. The following tips should help secure your site:

  • Remove or rename phpinfo.php, as it leaks valuable information about your web server.
  • Update your Apache and MySQL software with security patches, if any, from SunSolve. Solaris 10 uses Apache 1.3.3, MySQL 4.0.15, and PHP 4.3.2. For example, MySQL for Solaris 10 has a patch with several security fixes (patch 120292 SPARC or 120293 x86).
  • You may want to download and compile the latest PHP software from www.php.net. The command line used to configure PHP is given by the phpinfo.php script. For Solaris 10 it is:
./configure --disable-cli --with-apxs=/usr/apache/bin/apxs --with-config-file-path=/etc/apache \
            --with-mysql --enable-track-vars --prefix=/opt/sfw

See also[edit]

For more customizations and information see

External links[edit]