Mediawiki on Solaris10 with Zones and SunStudio and MySQL5
Last updated by: Compukid
Contents |
[edit] Overview
The goal is to setup mediawiki on Solaris 10 with an 64-bit database backend and an apache2 frontend with PHP5.
[edit] Hardware
- Sun Ultra 60
- 2x UltraSPARC-II 300Mhz
- 2x 9GB SCSI disk
- 640MB Memory
- 100Mb/s hme network interface
- Multipack
- 6x 18GB SCSI disk
[edit] Software
None of the software will cost money, you will only pay for support and media-kits. All sofware can be dowloaded for free.
[edit] Without full sourcecode available for free
- Solaris 10 1/06 (part of the sourcecode available on opensolaris.org)
- Sun Studio 11 (Compiler Suite from Sun Microsystems)(part of the sourcecode available on netbeans.org)
[edit] With full sourcecode available for free
- libxml2 2.6.27 compiled from source with Sun Studio (32-bit)
- php 5.2.0 compiled form source with Sun Studio (32-bit)
- MySQL Community Server 5.0.27 (32-bit SVR4 standard package) (webzone, needed for php mysql client)
- MySQL Community Server 5.0.27 (64-bit SVR4 max package) (dbzone)
- Apache HTTPD 2 (as shipped with Solaris 10)
- MediaWiki 1.8.2
[edit] Global Zone
I will be using SVM/UFS instead of ZFS as ZFS is not yet available in 1/06
- Install Solaris
- Use SVM to mirror the rootdisk
- Create SVM diskset on the multipack for all data
- Put all disks in the diskset in a RAID5 config
- Create softpartitions for the zones
# metastat -s multipack -p multipack/d102 -p /dev/md/multipack/rdsk/d0 -o 31457376 -b 20971520 multipack/d0 -r c1t1d0s0 c1t2d0s0 c1t3d0s0 c1t4d0s0 c1t5d0s0 c1t6d0s0 -k -i 32b multipack/d101 -p /dev/md/multipack/rdsk/d0 -o 20971584 -b 10485760 multipack/d100 -p /dev/md/multipack/rdsk/d0 -o 32 -b 20971520 # grep multipack /etc/vfstab /dev/md/multipack/dsk/d100 /dev/md/multipack/rdsk/d100 /opt ufs 2 yes - /dev/md/multipack/dsk/d101 /dev/md/multipack/rdsk/d101 /export/home ufs 2 yes - /dev/md/multipack/dsk/d102 /dev/md/multipack/rdsk/d102 /zones ufs 2 yes -
[edit] WebZone001
- Setup zone webzone001
zonecfg:webzone001> info
zonepath: /zones/webzone001
autoboot: true
pool:
fs:
dir: /export/home
special: /export/home
raw not specified
type: lofs
options: []
fs:
dir: /opt/software
special: /opt/software
raw not specified
type: lofs
options: []
net:
address: 192.168.0.15
physical: hme0
- boot webzone001
zoneadm -z webzone001
- connect to console and do basic setup
zlogin -C webzone001
- get Sun Studio 11 and install
- set path
PATH=/usr/bin:/opt/SUNWspro/bin:/usr/ccs/bin; export PATH
- get libxml2-2.6.27.tar.gz
- compile libxml2
./configure --prefix=/opt/libxml2; make; make install
- get mysql5.0.27 SVR4 pkg (standard, 32-bit) and install using pkgadd
groupadd mysql useradd -g mysql mysql pkgadd -d .
- get php-5.2.0.tar.bz2
cp /etc/apache2/httpd.conf-sample /etc/apache2/httpd.conf ./configure --with-apxs2=/usr/apache2/bin/apxs --with-libxml-dir=/opt/libxml2 --with-mysql=/opt/mysql/mysql --with-config-file-path=/etc/apache2 --prefix=/opt/php5 --with-zlib-dir=/usr/lib --with-mysqli=/opt/mysql/mysql/bin/mysql_config make make install
- Enable php5 in httpd.conf
- cat /etc/apache2/httpd.conf | grep -i php
LoadModule php5_module libexec/libphp5.so DirectoryIndex index.php index.html index.html.var AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps
- Enable apache2
svcadm enable svc:/network/http:apache2
[edit] DbZone001
- Setup webzone
zonecfg:dbzone001> info
zonepath: /zones/dbzone001
autoboot: true
pool:
fs:
dir: /export/home
special: /export/home
raw not specified
type: lofs
options: []
fs:
dir: /opt/software
special: /opt/software
raw not specified
type: lofs
options: []
net:
address: 192.168.0.16
physical: hme0
- Boot webzone and connect to console to do setup
- get mysql5.0.27 SVR4 pkg (max, 64-bit) and install using pkgadd
groupadd mysql useradd -g mysql mysql pkgadd -d .
- Make sure MySQL server starts on startup
cd /etc/rc3.d ln ../init.d/mysql S99mysql cd /etc/rc0.d ln ../init.d/mysql K00mysql
- run mysql_secure_installation
- create user for mediawiki or allow root to connect from webzone001 to dbzone001
[edit] Installation of mediawiki
- download mediawiki 1.8.2.tar.gz
- extract to /var/apache2/htdocs/mediawiki-1.8.2
- symlink /var/apache2/htdocs/wiki to /var/apache2/htdocs/mediawiki-1.8.2
- Point your browser to webzone001:/wiki/config and run setup
[edit] Next steps
[edit] Daily administration
- Create and test backups
- Use Nagios or other monitoring software to monitor your environment
- Use MySQL network for your database management and tuning
- Enable SSL in your MySQL configuration to secure communication between the web server and the database server.
- Enable SSL in your Apache 2 configuration to secure communication between the web server and the web browser.
- Get certified for MySQL 5.0, Solaris 10 and PHP (Zend)
[edit] Scaling out
- move the webzone to an different machine
- put more webservers in front of the database server using loadbalancing with an Sun N2000
- use MySQL Cluster to distribute the load
[edit] High Availability
- use MySQL Cluster or Sun Cluster to prevent downtime of the database
- use more webserver to prevent downtime of the website
- use IP Multipathing to make your network high available
- use SAN and MPXIO to make your storage high available
[edit] Disaster Recovery
- create backups using mysqldump, mysqlhotcopy or innodb hotcopy.
- use MySQL repliation or SAN based replication
- Test your DR plan