Solaris 9i Source Install Guide

Synopsis:


This guide walks through the install of Deki Wiki (and all software it relies on) on Solaris 9i. Everything is compiled from source, rather than via packages, as more control can be gained on the overall install (path's etc). The only package needed is a initial gcc one to get over the obstacle of having no compiler to compile with!

This guide is based on personal experience of getting it all up and running, so it is possible! I've tried to remember all steps/software needed but there may be gaps or pre-requisites that I have forgotten, basically this guide is on a best effort basis and I can't guarantee everything is her 100%, but it certainly isn’t that far off.

Install Methodology:


The idea behind this install procedure is as follows:

  1. Your starting from scratch, from an initial Solaris install (or near enough)
  2. Your server may be doing other activities, so keep as much software as possible in one place and out of the way, so as to minimise risk on other system tasks.
  3. You may need some kind of resilience for your wiki so allow for a install design which facilitates easy fail-over.


My suggested approach is that all software for deki wiki, and deki wiki itself had a dedicated mount point and dedicated external storage. This allows the overall system to remain as stable as before deki-wiki and it also means if you need a multi-node setup, its very easy to incorporate into cluster software.

My setup was as follows:

  • 10GB LUN on external hardware RAID5 array.
  • Veritas volume manager based filesystem (vxfs)
  • mount point located at /opt/device
  • Separate user defined with HOME at /opt/device


mount point hierarchy

/opt/device/thirdparty      -> used for all 3rd party software
/opt/device/www            -> used for Web root and /opt/device/www/wiki used for Deki Wiki root
/opt/device/conf              -> used for all configuration files and again /opt/device/conf/wiki for Deki Wiki conf files.
/opt/device/install            -> used for storing all software during the install procedures

Obviously your setup will depend on what resources you have to hand, I just made best use of the existing setup.

System:

SunOS otasg3 5.9 Generic_118558-33 sun4u sparc SUNW,Sun-Fire-V240 Solaris
System Configuration: Sun Microsystems  sun4u Sun Fire V240
System clock frequency: 1670 MHZ
Memory size: 4GB


Initial State:

As per Solaris Install. No cc installed:

bash-2.05$ /usr/ucb/cc -v
/usr/ucb/cc:  language optional software package not installed

no /usr/local directory.

Install Guide Notes


The following guide assumes you know the basic premise of compiling and installing software, which generally follows 4 steps:

  1. Configure the software for your machine, by running configure script
  2. run "make"
  3. run "make test" or "make check" to ensure compiled binaries work
  4. run "make install" to put compiled binaries / libraries etc into location specified during step #1


Rather than say these 4 steps eveytime I have just given the url of the location of the software and also given the command used to run the configure script (with all options used). This is generally the most important and most difficult to get right. Any other important notes are also given.

The Actual Guide

First Setup Dev Environment:

1. Get a compiled version of gcc

ftp://ftp.sunfreeware.com/pub/freewa...sparc-local.gz
ftp://ftp.sunfreeware.com/pub/freewa...sparc-local.gz

install both packages using 'pkgadd -d'

2. Compile GNU versions of binutils, make, bison and optionally (though recommended) latest gcc

bintutils        -> http://www.gnu.org/software/binutils/
configure options    -> ./configure

make            -> http://www.gnu.org/software/make/
configure options    -> ./configure

bison            -> http://www.gnu.org/software/bison/
configure options    -> ./configure

gcc            -> http://gcc.gnu.org/
configure options    -> ./configure --with-ld=/usr/local/bin/ld --with-as=/usr/local/bin/as --with-gnu-ld --with-gnu-as --enable-threads=posix --enable-shared

Next other pre-reqs and things which are needed later

mpfr            -> http://www.mpfr.org/
configure options    -> ./configure

gmp            -> http://gmplib.org/
configure options    -> ./configure

glib            -> http://www.gtk.org/
configure options    -> ./configure

libxml            -> http://xmlsoft.org/
configure options    -> ./configure

zlib            -> http://directory.fsf.org/project/zlib/
configure options    -> ./configure

openssl            -> http://www.openssl.org/
configure options    -> ./config --prefix=/opt/device/thirdparty/openssl enable-shared

libpng            -> http://www.libpng.org/pub/png/libpng.html
configure options    -> ./configure --prefix=/opt/device/thirdparty/libpng

gd            -> http://www.boutell.com/gd/
configure options    -> ./configure --prefix=/opt/device/thirdparty/libgd --with-png=/opt/device/thirdparty/libpng

curl            -> http://curl.haxx.se/
configure options    -> ./configure --prefix /opt/device/thirdparty/curl --with-ssl=/opt/device/thirdparty/openssl

http            -> http://www.apache.org
configure options    -> ./configure --prefix=/opt/device/thirdparty/httpd/ --enable-modules=all --enable-proxy --enable-proxy-http --enable-rewrite --enable-ssl --with-ssl=/opt/device/thirdparty/openssl/

Compile and install mysql

add mysql user:

groupadd mysql
useradd -g mysql mysql

mysql            -> http://www.mysql.com
configure options    -> ./configure --prefix /opt/device/thirdparty/mysql
do post install        -> http://dev.mysql.com/doc/refman/5.0/...tallation.html

now should have operational database :-)

PHP Install

php            -> http://www.php.net/
configure options    -> ./configure  --prefix=/opt/device/thirdparty/php --with-mysql=/opt/device/thirdparty/mysql --with-apxs2=/opt/device/thirdparty/httpd/bin/apxs --with-zlib --enable-mbstring -with-gd=/opt/device/thirdparty/libgd --with-curl=/opt/device/thirdparty/curl --with-png-dir=/opt/device/thirdparty/libpng

For php you need to create a php directory within your apache directory for the php.ini file. so

cd /opt/device/thirdparty/httpd
mkdir php
cp /opt/device/install/php-5.2.5/php.ini-recommended ./php/
cp ./php/php.ini-recommended ./php/php.ini


php.ini-recommended will be the default config, were keep this encase we ever need to go back to it, now were need to edit the php.ini file to make a few changes.

so edit php.ini and make the following changes:

 

#set date.timezone to where you are
date.timezone = "Europe/London"

# add in php includes
include_path = ".:/php/includes:/opt/device/thirdparty/php/lib/php"

# change post_size to 1GB, or whatever you want it set too
post_max_size = 1024M

# chnage upload_max_filesize to 1GB or whatever you want it set too
upload_max_filesize = 1024M

Compile Mono

Note: You need to avoid the current "release" and go for a daily build (as there was a bug which effected deki-wiki). My build was 2008-02-22. Anything later than this will work too.

Daily builds available at: http://mono.ximian.com/daily/


configure options    -> ./configure --prefix=/opt/device/thirdparty/path/mono --with-tls=pthread --includedir=/usr/local/ --libdir=/usr/local/ --with-ld=/usr/local/bin/ld --with-as=/usr/local/bin/as


Note: Do not do a make test / make check. Caused process to halt and stop operating!, just do straight from make to make install (assuming no problems with make)
Note2: Takes blooming ages .....

Onto the Deki Wiki goodness

Go get the latest version of Deki Wiki (I used Itasca 1.9.0a) http://sourceforge.net/projects/dekiwiki

The offical from source instructions are here: http://wiki.opengarden.org/Deki_Wiki..._Upgrade_Guide, but skip the apache conf for the moment

First untar and copy the web directory where your want to have it. Mine was under /opt/device/www/wiki

Apache config

I decided that I wanted deki wiki to be a virtual host, this means you can have several web services running off the same machine all with different domain names. So the physical machine host doesn’t need to be your deki wiki host, instead of http://physicalmachine/wiki, you can have http://wiki.physicalmachine or http://wiki.completlydifferentdomain. It just means you have to setup your dns server with the some aliases.

Anyway ... so the apache config ....

In httpd.conf

un-comment the virtual host include and add in your own virtual host include for deki-wiki :

# Virtual hosts
Include conf/extra/httpd-vhosts.conf
Include conf/extra/deki-apache.conf

add in the deki-wiki Proxy command:

# added for deki wiki
<Proxy *>
    AddDefaultCharset off
    Order deny,allow
    Deny from all
    Allow from all
</Proxy> 


also add in the php config:

# Use for PHP 5.x:
LoadModule php5_module        modules/libphp5.so
AddHandler php5-script php

# Add index.php to your DirectoryIndex line:
DirectoryIndex index.html index.php

AddType text/html       php

# PHP Syntax Coloring
# (optional but useful for reading PHP source for debugging):
AddType application/x-httpd-php-source phps
PHPIniDir /opt/device/thirdparty/httpd/php


in ./extra/httpd-vhosts.conf

This is the place for the default virtual host, if no other matches are found. Also comment out the example dummy virtual host config and you should have something like:

NameVirtualHost *

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *>
    DocumentRoot "/opt/device/thirdparty/httpd/htdocs"
    ServerName physicalmachine
</VirtualHost>

#<VirtualHost *:80>
#    ServerAdmin webmaster@dummy-host2.example.com
#    DocumentRoot "/opt/device/thirdparty/httpd/docs/dummy-host2.example.com"
#    ServerName dummy-host2.example.com
#    ErrorLog "logs/dummy-host2.example.com-error_log"
#    CustomLog "logs/dummy-host2.example.com-access_log" common
#</VirtualHost> 


create deki-apache.conf in the extra directory with the following config:

 <VirtualHost *>
        ServerName wiki.device

        ErrorLog /var/log/apache2/error.log
        CustomLog /var/log/apache2/access.log common

        DocumentRoot "/opt/device/www/wiki"

        RewriteEngine On
        RewriteCond %{REQUEST_URI} ^/$
        RewriteRule ^/$ /index.php?title= [L,NE]

        RewriteCond %{REQUEST_URI} ^/@gui/[^.]+$
        RewriteRule ^/@gui/(.*)$ /proxy.php?path=$1 [L,QSA,NE]

        RewriteCond %{REQUEST_URI} !^/(@api|editor|skins|config|@gui)/
        RewriteCond %{REQUEST_URI} !^/index\.php
        RewriteCond %{REQUEST_URI} !^/favicon\.ico$
        RewriteCond %{REQUEST_URI} !^/robots\.txt$
        RewriteCond %{QUERY_STRING} ^$ [OR] %{REQUEST_URI} ^/Special:Search
        RewriteRule ^/(.*)$ /index.php?title=$1 [L,QSA,NE]

        # deki-api uses encoded slashes in query parameters so AllowEncodedSlashes must be On
        AllowEncodedSlashes On

        # mod_proxy rules
        ProxyPass /@api http://localhost:8081 retry=1
        ProxyPassReverse /@api http://localhost:8081
        SetEnv force-proxy-request-1.0 1
        SetEnv proxy-nokeepalive 1

</VirtualHost>


ServerName will be the domain you decide to use for your deki wiki, here mine is wiki.device, in your browser you would goto http://wiki.device

Configuring Deki Wiki


so now create the deki wiki log directorys

mkdir /var/log/dekiwiki
touch /var/log/dekiwiki/deki-api.log

create a conf directory for deki wiki, I put mine in /opt/device/conf/wiki

mkdir /opt/device/conf
mkdir /opt/device/conf/wiki 

copy mindtouch.deki.startup.xml and mindtouch.host.conf into the wiki conf directory

cp /opt/device/www/wiki/config/mindtouch.deki.startup.xml.in /opt/device/conf/wiki/mindtouch.deki.startup.xml
cp /opt/device/www/wiki/config/mindtouch.host.conf.in /opt/device/conf/wiki/mindtouch.host.conf


edit mindtouch.host.conf, making sure the MONO, BIN_DIR and SCRIPT variables are correct

# The full path to your mono executable
MONO="/opt/device/thirdparty/mono/bin/mono"

# The location of your wiki's bin directory
BIN_DIR="/opt/device/www/wiki/bin"

# path to the Deki Wiki configuration xml file
SCRIPT="/opt/device/conf/wiki/mindtouch.deki.startup.xml" 


now onto the actual start script, again I put this is the wiki/bin directory.

The original start script is here: /opt/device/www/wiki/config/mindtouch.host.sh I had big problems with this script, mainly as the variables were not set correctly (has % symbols ?) also used variable names like $PATH-PREFIX this doesnt work in solaris, you can't have a "-" in a variable (echo $PATH-PREFIX will give you the contents of $PATH + "-PREFIX")

I've attached my altered start script, I would suggest you base yours on the attached, or maybe your have better luck than me on the original :-)

Start everything....

So we need to ensure mysql, httpd and the mono deki-wiki processes are all up and running. I do this as Root (you have to for httpd),

/opt/device/thirdparty/mysql/mysqld_safe -user=mysql &
/opt/device/thirdparty/httpd/bin/apachectl start
/opt/device/www/wiki/bin/mindtouch.host.sh start


goto http://yourvirtualhost (http://wiki.device for me) and follow the prompts to install the deki wiki database ... and your away !!!

Start / Stop deki-wiki stack script

So now hopefully you have a fully functioning deki-wiki install, the last thing to do (for now) is to ensure the deki-wiki stack (mysql, httpd and mindtouch) start and stop on server start and shutdown.

I have attached a start/stop script "dekiwiki.sh" which is just a basic script to start/stop on run level change. Put the file into /etc/init.d then create your symlinks in:

/etc/rc3.d (for start - called "S99dekiwiki")

/etc/rcS.d
/etc/rc0.d
/etc/rc1.d
/etc/rc2.d (for stop - called "K00dekiwiki" - note links should be created in all 4 dir's for safety)

Still to come:

  • Configuring search indexing tools to work in Solaris (they dont as standard and rely on default paths.



Tag page

Files 2

FileSizeDateAttached by 
 dekiwiki_start.sh
No description
892 bytes22:46, 27 Apr 2008faseaActions
 mindtouch.host.sh
No description
2.5 kB22:44, 27 Apr 2008faseaActions
Viewing 1 of 1 comments: view all
fasea,

You can run the web-installer (http://<hostname>/config/index.php) to configure "mindtouch.host.sh", "mindtouch.host.conf" and "LocalSettings.php" automatically.

This installer inserts parameters to template, that user entered from web forms, and generate files that can be available as is.

Template shell script : /opt/device/www/wiki/config/mindtouch.host.sh
Configured shell script : /opt/device/www/wiki/bin/mindtouch.host.sh

For your information, there are an example on my guide:
http://wiki.opengarden.org/User:Yasuaki/Sun_SPARC_Solaris_8_(Itasca) edited 23:39, 29 Apr 2008
Posted 12:29, 29 Apr 2008
Viewing 1 of 1 comments: view all
You must login to post a comment.