Installing an existing LiveDVD
Please note that the current version requires the username to be "jboss" and host "ca-server" when installing to a harddrive to get automatic startup of EJBCA, just like on the DVD.
About
A live CD/DVD is a great why to get others to try out EJBCA with your specific configuration using either virtualization or simple booting the DVD.
This guide is based on the 32-bit version of Ubuntu 8.10 and the remastersys-script, but whatever remastersys supports will work. The Unlimited Strength JCE Policy might be a bad idea to install if you plan on sharing the DVD with others.
Setting up the base
Install Ubuntu 32-bit in VMware (or your favourite virtualization solution) with default user "jboss" and password "foo123"
Setup Remastersys
There are different packages for remastersys depending on ubuntu version.
For Gutsy and earlier do:
sudo echo "deb http://www.geekconnection.org/remastersys/repository remastersys/" >> /etc/apt/sources.list
For Hard and newer with original Grub do:
sudo echo "deb http://www.geekconnection.org/remastersys/repository ubuntu/" >> /etc/apt/sources.list
For Karmic and newer with Grub2 do:
sudo echo "deb http://www.geekconnection.org/remastersys/repository karmic/" >> /etc/apt/sources.list
Then continue with:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install remastersys
patch /usr/bin/remastersys (needed for 2.0.7):
Search for HOST piped into /etc/casper.conf and replace $LIVEUSER with $HOST
Comment out "#md5sum $WORKDIR/$CUSTOMISO > $WORKDIR/$CUSTOMISO.md5". We should use "sha1sum -b livedvd.iso" > livedvd.iso.SHA1 instead.
edit /etc/remastersys.conf
HOST="$(hostname)"
LIVEUSER="jboss"
LIVECDLABEL="EJBCA Live CD"
Setup EJBCA
Install OpenJDK and ant
sudo apt-get install openjdk-6-jdk ant ant-optional
Install JBoss in /home/jboss/jboss (JBoss 4.2.3.GA requires much less memory than JBoss 5.0.0.GA so we will use that for now.)
Install EJBCA in /home/jboss/ejbca
add /etc/init.d/jboss:
#! /bin/sh
### BEGIN INIT INFO
# Provides: jboss
# Short-Description: JBoss AS init script
### END INIT INFO
PATH=/usr/sbin:/usr/bin:/sbin:/bin
NAME=jboss
SCRIPTNAME=/etc/init.d/${NAME}
DO_SNAPSHOT=/sbin/${NAME}-snapshot
case "$1" in
start)
sudo su jboss -c '/home/jboss/jboss/bin/run.sh' &
;;
stop)
sudo su jboss -c '/home/jboss/jboss/bin/shutdown.sh -S'
;;
*)
echo "Usage: $SCRIPTNAME {start|stop}" >&2
exit 3
;;
esac
Make sure JBoss is started with the OS
sudo update-rc.d -f jboss start 2 3 4 5 . stop 0 1 6
Setup Firefox to automatically display Admin GUI and our custom info
add /home/jboss/.config/autostart/firefox.desktop:
[Desktop Entry]
Type=Application
Encoding=UTF-8
Version=1.0
Name=No Name
Name[en_US]=Firefox
Exec=/home/jboss/bin/waitAndStart.sh
X-GNOME-Autostart-enabled=true
Add /home/jboss/bin/waitAndStart.sh:
sleep 10
while [ "`grep Server.*JBoss.*Started /home/jboss/jboss/server/default/log/server.log 2>/dev/null`x" = "x" ] ; do echo -n "." ; sleep 2 ; done ; echo "." ;
firefox
Configure Firefox to show the Admin GUI and import the right superadmin cert from EJBCA.
It's a good idea disable network connectivity checking in Firefox, since your local pages will appear broken if the user doesn't start the LiveDVD with a connected network interface. Enter "about:config" in the URL-bar in Firefox and change the key "toolkit.networkmanager.disable" to "true".
Remove dead meat
rm /home/jboss/jboss/server/minimal -rf
rm /home/jboss/jboss/server/all -rf
sudo apt-get purge "all openoffice components except the language components" ~110Mb
sudo apt-get purge "all evoluion components except the one that also removes gnome" ~80Mb
sudo apt-get purge gimp-data ~41Mb (removes ubuntu-desktop package)
sudo apt-get purge pidgin-data ~27Mb
sudo apt-get purge "all totem" ~10Mb
sudo apt-get purge rhythmbox 13MB
sudo apt-get purge f-spot 9MB
sudo apt-get purge xsane-common 4MB
sudo apt-get purge gnome-screensaver update-notifier compiz-fusion-plugins-extra gnome-orca samba-common
etc
sudo apt-get auto-remove
You can list installed packages sorted by size (in kb) by using
dpkg-query --show --showformat='${Package;-50}\t${Installed-Size} ${Status}\n' | sort -k 2 -n | grep -v deinstall
to find additional packages to remove.
Test the setup
Reboot your virtual machine and verify that things work as expected.
Prepare the live session user's home directory
sudo cp -r /home/jboss/.mozilla /etc/skel/
sudo cp -r /home/jboss/.config /etc/skel/ # You probably only want .config/autostart here
sudo cp -r /home/jboss/ejbca /etc/skel/
sudo cp -r /home/jboss/jboss /etc/skel/
sudo cp -r /home/jboss/bin /etc/skel/
sudo chown -R root:root /etc/skel/*
sudo chown -R root:root /etc/skel/.*
/usr/share/gconf/defaults/05_panel-default-setup.entries: Comment out the evolution launcher from the panel in the defaults
<!--
<value>
<string>email_launcher</string>
</value>
-->
Create the DVD
sudo remastersys dist
copy/burn /home/remastersys/remastersys/customdist.iso
sudo remastersys clean
Test installation
Try to install the livedvd (to a VMware disk) with username "jboss" and hostname "ca-server" and verify that installation works.
Troubleshooting
The LiveDVD will deny user login if it runs out of memory (1024M worked for me) or any dir in /etc/skel/ is not owned by root.
Also EJBCA and SignServer will fail to deploy if JBoss runs out of memory.





