Virtual Guru's Blog – Home of Virtualization Workshops

December 10, 2009

WebStack (TMJ) in OpenSolaris JeOS Prototype (with Tomcat6)

Filed under: cloud, jeos, opensolaris, virtualbox, Virtualization — natiku @ 3:46 am

OpenSolaris 200906 JeOS Prototype is PURE CLI enviroment, so its small true command line only enviroment, as such is ideal install BASE for web services like is WebStack TMJ = Tomcat MySQL Java.

In this example I will demonstrate use of WebStack TMJ Tomcat6, MySql 5.1 , Java 6 (JDK) from PKG OpenSolaris 200906 repository on OpenSolaris 200906 JeOS Prototype.

General Information – JeOS Prototype OpenSolaris project

Download OpenSolaris 200906 JeOS Prototype VM for one 10+ most popular Virtualization Formats:

JeOS: Just enough OS Project Homepage

OpenSolaris 2009.06 JeOS Prototype VM Images Download

OpenSolaris 2009.06 JeOS Prototype 10 Simple Usage Samples

Discussion (Main page)

Discussion (Archives)

Part 1: Check JeOS readiness as user root

1. Switch to root

pfexec su - root

2a. Check, if PKG will clean download cache on SUCCESS

root@osol-jeos:~# pkg property flush-content-cache-on-success
PROPERTY                       VALUE
flush-content-cache-on-success True

2b. Check, then we increase PKG download patience for slowest networks

root@osol-jeos:~# set | grep PKG

2c. Check, then we use right main repository for

root@osol-jeos:~# pkg publisher
PUBLISHER                             TYPE     STATUS   URI          (preferred)  origin   online
contrib                               origin   online

2d. Check, then we can access these repositories

root@osol-jeos:~# pkg refresh --full

2e. Check, download speed of whole repository catalog

root@osol-jeos:~# curl >/dev/null
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Dload  Upload   Total   Spent    Left  Speed
100 1333k  100 1333k    0     0  93491      0  0:00:14  0:00:14 --:--:--  126k

2f. Check, if we have enough memory and activated swap (I recommend if possible to have VM with 768MB-1GB RAM configured)

root@osol-jeos:~# top | grep Memory
Memory: 1024M phys mem, 525M free mem, 512M total swap, 512M free swap

2g. Check, if you have enough disk space in host, in case then you use a growing Virtual disk Format

At least 2GB of disk space is needed

Part2: Install WebStack TMJ on OpenSolaris JeOS Prototype

WebStack in OpenSoalris 2o0906 is version 6 and it requires a JDK6 installation (Which is not forced by iPKG dependencies)

1. Installing full JDK 6 in smaller download chunks

root@osol-jeos:/~# pkg install SUNWj6rt
DOWNLOAD                                    PKGS       FILES     XFER (MB)
Completed                                    1/1     686/686   31.77/31.77
PHASE                                        ACTIONS
Install Phase                                880/880
Deleting content cache

Next install Java Dev

root@osol-jeos:/~# pkg install SUNWj6dev
DOWNLOAD                                    PKGS       FILES     XFER (MB)
Completed                                    1/1     284/284   33.53/33.53
PHASE                                        ACTIONS
Install Phase                                351/351
Deleting content cache

Next install rest of Java packages

root@osol-jeos:/~# pkg install SUNWj6dmo SUNWj6dmx SUNWj6rtx SUNWj6dvx SUNWj6man SUNWj6cfg
DOWNLOAD                                    PKGS       FILES     XFER (MB)
Completed                                    6/6   1960/1960   19.50/19.50
PHASE                                        ACTIONS
Install Phase                              2489/2489
Deleting content cache

2. Install MySQL DB and MySQL JDBC driver in chunks

root@osol-jeos:~# pkg install  SUNWmysql51 SUNWmysql-base
DOWNLOAD                                    PKGS       FILES     XFER (MB)
Completed                                    2/2     335/335   84.19/84.19
PHASE                                        ACTIONS
Install Phase                                427/427
Deleting content cache
root@osol-jeos:~# pkg install  SUNWmysql51lib
DOWNLOAD                                    PKGS       FILES     XFER (MB)
Completed                                    1/1         9/9     5.16/5.16
PHASE                                        ACTIONS
Install Phase                                  47/47
Deleting content cache
root@osol-jeos:~# pkg install  SUNWmysql5jdbc
DOWNLOAD                                    PKGS       FILES     XFER (MB)
Completed                                    1/1       12/12     0.76/0.76
PHASE                                        ACTIONS
Install Phase                                  25/25
Deleting content cache

Don’t forget to add MySQL Connector/J to container JAR PATH

root@osol-jeos:~# pkg contents -m  SUNWmysql5jdbc | grep ".jar" | awk '{print $7}'

Note: If you will like to use instead a latest MySQL Connector/J 5.1 , get jar at MySQL Connector/J 5.1 {5.1.10}

3. Installing Tomcat 6 package

root@osol-jeos:~# pkg install SUNWtcat
DOWNLOAD                                    PKGS       FILES     XFER (MB)
Completed                                    1/1     555/555     5.87/5.87
PHASE                                        ACTIONS
Install Phase                                678/678
Deleting content cache

Part 3: Configure and use TMJ WebStack

Tomcat 6 package is fully integrated into SMF

root@osol-jeos:~#  svcadm enable tomcat6
root@osol-jeos:~# svcs -l tomcat6
fmri         svc:/network/http:tomcat6
name         Apache Tomcat 6
enabled      true
state        online
state_time   Thu Dec 10 13:35:10 2009
logfile      /var/svc/log/network-http:tomcat6.log
restarter    svc:/system/svc/restarter:default
contract_id  73
root@osol-jeos:~# ls /etc/tomcat6/
CONF.tar.gz  tomcat-users.xml
catalina.policy  context.xml          server.xml          web.xml
root@osol-jeos:~# ls /var/tomcat6/logs/
admin.2009-12-10.log         catalina.out                 localhost.2009-12-10.log
catalina.2009-12-10.log      host-manager.2009-12-10.log  manager.2009-12-10.log
root@osol-jeos:~# tail /var/tomcat6/logs/catalina.out
Dec 10, 2009 1:35:11 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0-snapshot
Dec 10, 2009 1:35:12 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Dec 10, 2009 1:35:12 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /
Dec 10, 2009 1:35:12 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/23  config=null
Dec 10, 2009 1:35:12 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 713 ms

See more in:

Web Stack Getting Started Guide

WebStack OpenSolaris Home


1 Comment »

  1. […] WebStack (Tomcat, MySQL, Java) in OpenSolaris JeOS Prototype […]

    Pingback by OpenSolaris JeOS (Main Page) « Virtual Guru's Blog – Home of Virtualization Workshops — February 7, 2010 @ 3:49 pm

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Blog at

%d bloggers like this: