Friday Sep 07, 2007

Setting up the Sun JavaCAPS UDDI Server on Ubuntu

This document details how to setup the Sun JavaCAPS UDDI Server on Ubuntu.
  • Download the Linux (Intel x86) version of the JavaCAPS Applications ISO - in this case it was named java-caps-5_1_3-linux_x86.iso.  For those of you who are JavaCAPS literate - this is the disk that contains the Enterprise Manager, logical host, and UDDI Server/Repository.  Note: at the present time [version 5.1.3] of JavaCAPS is not freely available for download.  In the near future this (along with all Sun products) will change.  I do not have insight as to the time frame and/or if the UDDI Server will be broken out from the JavaCAPS application itself.  
  • Open java-caps-5_1_3-linux_x86.iso (the file downloaded above) and extract the stcuddi-Linux_x86.sar to a temporary directory.
  • Open the stcuddi-Linux_x86.sar and extract its contents to another temporary directory.  For example, I called mine UDDItmp.
  • Unbundle the stcuddi-Linux_x86.tar.gx.  This will create a UDDIInstaller directory
  • Open a shell and go to the UDDIInstaller directory and execute the script
For the following steps, you have considerable flexibility.  I will document my settings for you...
  • When prompted, enter the desired installation location for the UDDI Server.  In my case it was /home/kkranz/apps/UDDI
  • For the name of the UDDI Server enter: CAPSUDDI
  • Enter 8190 for the port number.  This will translate to the range 8190-8199, so be sure that range is open.
  • For the user name enter Administrator
  • For the password: adminadmin
  • Verify the password.
The script will then install the UDDI Server.  If successful, you should get a:
        UDDI Server installed successfully.
        Please start the UDDI Server.

To verify the install:
  • Start the UDDI Server (eg: cd~/apps/UDDI;
  • Point your browser to: http://localhost:8190/CAPSUDDI/
  • To publish WSDLs to the repository, point your browser to: http://localhost:8190/UDDIReg

Finally, to complete the installation process, you should create the appropriate rc.init start and stop scripts.

Tuesday Aug 07, 2007

Setting up GlassFish on Ubuntu

This document details how to setup GlassFish on Ubuntu as a non-root user - given Ubuntu does not have a dedicated root user account.  The goal of this text is to install GlassFish on ports 8081/8181 (http/https) with the administrator port on 4848.  In addition, instructions will be given how to configure the /etc/init.d directories so the default (domain1) server automatically starts and stops with the boot process.

As with the other documents in this series, I will assume little GlassFish and only moderate Ubuntu knowledge.


  • start synaptic package manager and download "ant - A Java based build tool like make".  Note: a copy of ant can be found in the GlassFish download, but it doesn't hurt to have the universe version installed.
  • The version of glassfish detailed here requires Java 5.0 (aka JDK 1.5).  Download and install JDK 1.5 then set JAVA_HOME to point to the base directory of 1.5.  Note: if you have installed the Sun Java WebServer then you already have a copy of JDK 1.5 installed.  Details on how to install the Sun Java Web Server on Ubuntu can be found here.
  • (optional) Start synaptic package manager and download "ksh - The real, AT&T version of the Korn Shell" from the Shell Universe.

To set your JAVA_HOME (in this case to the 1.5 JDK within the Sun Java WebServer) via the following commands:
  • cd ~
  • open .profile in your favorite text editor.  Yes, you can use a real one like vi.
  • add the following line at or near the end of the file:
    export JAVA_HOME=/home/kkranz/apps/webserver7/jdk
  • Source the profile: (. .profile) or simply open and use a new terminal window

Installing GlassFish Itself:

  • download your desired glassfish release.  (In my case it was glassfish-installer-v2-b50g.jar)
  • Copy glassfish-installer-v2-b50g.jar to the parent directory where you want to install the server.  (In my case it was ~/apps/glassfish)
  • Go to the parent directory and execute
    java -Xmx256m -jar glassfish-installer-v2-b50g.jar
  • (optional) rename the resulting "glassfish" directory to match your version of glassfish.  Example: glassfish_v2_b50.  For example the fully qualified path to my glassfish install is ~/apps/glassfish/glassfish_v2_b50.  I will refer to this as the [GlassFishHome].  You only need to do this if you too have a swiss cheese brain like me and will forget over time and/or possibly have more than one version of glassfish installed at a time.
  • (optional) change your http, https, and/or admin port numbers if they are already in use by other applications.  For example: oracle is already occupying port 8080 on my machine.  To change the default http port for glassfish, edit the setup.xml file and search for "instance.port".  Change the 8080 value to another port (eg: 8081).  Note: in the section where instance.port is defined, you will see other settings for admin port, admin password, default domain name, etc.  Modify them as necessary.
  • In your [GlassFishHome] execute the following command:
        ant -f setup.xml
  • (optional) Remove the glassfish-installer-v2-b50g.jar file
You may now refer to the standard glassfish documentation.  As a shortcut, to start (and stop) your server execute the following commands:
    cd [GlassFishHome]/bin
    ./asasmin start-domain domain1

If you point your browser at http://localhost:8081/ you should see the ubiquitous "your server is up and running" page (assuming you changed your http - otherwise it will be 8080).  http://localhost:4848 will bring up the administration page.

Setting up the /etc/init.d/GlassFish Files:

If you would like your glassfish server to start at boot time then you need to create the necessary /etc/init.d files - much like you did with the Sun Java Web Server.  The core of the init.d file is shown below.  

case "$1" in
    ${GLASSFISHHOME}/bin/asadmin start-domain domain1
    ${GLASSFISHHOME}/bin/asadmin stop-domain domain1
    ${GLASSFISHHOME}/bin/asadmin stop-domain domain1
    ${GLASSFISHHOME}/bin/asadmin start-domain domain1
    echo $"usage: $0 {start|stop|restart}"
    exit 1

Create the above file using:
    sudo gedit /etc/init.d/GlassFish
Then add execute permissions:
    sudo chmod a+x /etc/init.d/GlassFish
Finally create the necessary run level links to start the server in states 2-5 and to terminate it in states 0,1, and 6.  


If, by now, you are tired of creating the links in the various rcX.d directories and remembering to get the file permissions correct. The following script will do it for you.  In fact, the only thing it wont do is write the start/stop script for you. 



# Author: Ken Kranz - Sun Microsystems, Inc
# NOTE: this script makes use of Korn Shell commands.  You must download "The real,
# AT&T version of the Korn Shell" from the Shell universe.
# creates the proper links from the various rcX.d directories to the TARGET file
# located in the /etc/init.d directory.  It assumes a standard startup config,
# namely the TARGET is started in run states 2-5 and shutdown in states 0,1 and 6.
# For this script to work, the /etc/init.d/TARGET file must already exist.  Once found
# it creats the /etc/rcX.d links back to the TARGET and, for good measure, does a
#    chomd +x
# on the target.
# You can run this script multiple times.  I might complain that the links exist, but it
# continue on.  aka: if you aborted a previous run, you can rerun to complete the link process
# NOTE: if you decide to rerun this script with a different TARGET to NUMBER value, it will
# NOT remove the existing links.  So, be careful, you don't want to be creating duplicate
# start or stop scripts.

USAGE="$(basename $0) TARGET NUMBER"

if [[ $# != 2 ]]; then
    echo $USAGE
    exit 0

if [[ x$TARGET = x ]]; then
    echo missing TARGET
    echo $USAGE
    exit 1
if [[ x$NUMBER = x ]]; then
    echo missing NUMBER
    echo $USAGE
    exit 1

if [[ ! -e /etc/init.d/$TARGET ]]; then
    echo cannot find $TARGET
    exit 1

sudo chmod a+x /etc/init.d/$TARGET

sudo ln -v -s /etc/init.d/$TARGET /etc/rc0.d/K${NUMBER}$TARGET
sudo ln -v -s /etc/init.d/$TARGET /etc/rc1.d/K${NUMBER}$TARGET
sudo ln -v -s /etc/init.d/$TARGET /etc/rc2.d/S${NUMBER}$TARGET
sudo ln -v -s /etc/init.d/$TARGET /etc/rc3.d/S${NUMBER}$TARGET
sudo ln -v -s /etc/init.d/$TARGET /etc/rc4.d/S${NUMBER}$TARGET
sudo ln -v -s /etc/init.d/$TARGET /etc/rc5.d/S${NUMBER}$TARGET
sudo ln -v -s /etc/init.d/$TARGET /etc/rc6.d/K${NUMBER}$TARGET

Sunday Aug 05, 2007

Setting up VMWare on Ubuntu

With one hitch (which mainly only effects my machine configuration) the VMWare installation on Ubuntu is fairly straight forward::

  • Obtain a VMWare Server serial number by registering at the VMWare website
  • Add the universe, multiverse and (important) commercial repositories
  • Start Synaptic Package Manager
  • Search for "vmware-server"
  • mark the "vmware-server" for installation. Via dependencies, it should also select the "vmware-server-kernel-modeluesxxx" for installation
  • hit apply
  • when prompted, enter the VMWare server serial number

I had noticed that,sometimes, it seems that the VMs cannot connect to the host via the network. I had experimented with installing Ubuntu several times.  Every so offen, for a given install, none of the VMs would have network connectivity.  It was all or nothing.  Either all the VMs I created (XP, Solaris, Ubuntu) had network connectivity or none did.


I finally figured out what the cause of the problem was.  It revolved around the fact I have two network adapters, but only one is physically connected to the network. It so happens that ln0 was disconnected and ln1 was connected. In my latest reinstallation of Ubuntu, I forgot to disable ln0 before installing VMWare. Consequently, when I installed VMWare it attached to ln0 - resulting in none of my VM's having network connectivity.

I could not figure out how to reroute the VM network in the configuration files. Instead, I disabled ln0 then uninstalled  and reinstalled VMWare. I then pointed to my existing VM images and everything was good.

Unknown if, had I had ln0 connected and ln1 disconnected, would the VM problem arose.  Either way, if you have a network adapter that is not physically connected, it is best to disable it before proceeding with the VM install.  I will, eventually, lookup how to change network adapters on the VM site and detail the steps here.  

Thursday Aug 02, 2007

Installing Sun Java System Web Server 7 on Ubuntu

correction of ln command[Read More]

Setting up Ubuntu to run with the full Sun/Java web stack

I have a need to setup Ubuntu 7.04 for a project I am currently working on. Being new to Ubuntu, I thought it would be nice to document the steps involved. Ubuntu is a little different in that there is no root user per say. If you forget to sudo your installation scripts odd things happen that can get you into a rat hole... especially if you (like me) are new to Ubuntu.

Don't expect super great insights here - just points of interest and general guidance / suggestions. Also, don't expect redocumentation of what is already available. Where documentation exists and is accurate, I will point you to it. Also, don't look here for and insight into older versions of Ubuntu

Who should read this thread? If you plan on installing Ubuntu and you would like to include the full Sun / Java Open Source stack (namely: Sun Web Server, Netbeans, Glassfish, etc) plus some 3rd party applications (eg: Oracle, VMWare) then this thread is for you. I make no assumptions of Ubuntu of Sun experience. In fact; I am trying to target that group of people with little Ubuntu or Sun/Java experience.

Where the process goes smoothly, I will just outline the steps and point you to the right documentation and software to download. Where things get ugly, I will have a bit more to say. Out of the box, Ubuntu has other (default) web applications (eg apache). What that is well and good, I will touch upon how you undo (or not select them to begin with.

Machine Config: the machine in question is a Sun Ultra 40 Workstation configured as follows:

  • 2 - AMD Opteron Model 280 (Dual-core) processors
  • 8 - GB (4 \* 2 GB) DDR-400 ECC memory
  • 3 - 250 GB 7200 RPM SATA Disk
  • 1 - NVIDIA Quadro FX3500 PCI-Express graphics card
  • 1 - DVD Dual
  • 2 - 10/100/1000 Ethernet ports
  • 2 - x16 PCI-Express slots
  • 2 - x4 PCI-Express slots
  • 2 - legacy PCI slots
  • 4 - GB (2 \* 2 GB) DDR-400 ECC memory kit for Sun Ultra 40 workstation
  • 1 - 24.1-inch TFT LCD Color Monitor (27 inch CRT equivalent)
  • 1 - NVIDIA Quadro FX 560 entry 3D graphics card Installation

Goals: Setup a Ubuntu server that is running the full Sun / Java open source web stack in place of the default Apache / MySQL servers. Products to be installed and configured include:

  • Sun WebServer
  • Netbeans (5.5.1 and 6.0)
  • Glassfish
  • VMWare with the following virtual machines:
    • Windows XP
    • Solaris 10
    • Ubuntu - for experimentation
  • Oracle 10g
  • Access Manager
  • Identity Manager
Final point: Much of what you will find here will be (IMHO) fairly mundane. The bottom line is that I need to document what issues I ran into and I figured that I would share them with others so that we might all benefit. Consequently; any feed back is welcome.



« March 2017