These instructions were developed on a Pentium II 300Mhz system with a 4GB harddisk drive and 256MB of RAM. I first did a clean install of Xubuntu (that is, Ubuntu with the Xfce rather than the Gnome desktop) and then removed the bulkier surplus software like the Gimp and Abiword processor. Having got things running as detailed below, I installed the openssh server. I run the system without a monitor, mouse or keyboard, and login to it across my network from my main desktop machine using putty. This gives full command line access to the system.
If you installing or testing on a remote machine you will need to replace localhost where it appears in these instructions with the hostname of the remote machine.
Once the system is running the various bits and pieces will not need restarting after a reboot, except for JBoss. Instructions for starting this from the command line interface are given at the end of 5) below.
0) Set the repository list
The following lines, or their equivalent for your location, should appear in /etc/apt/sources.list.
deb http://gb.archive.ubuntu.com/ubuntu/ gutsy main restricted
deb http://gb.archive.ubuntu.com/ubuntu/ gutsy-updates main restricted
deb http://security.ubuntu.com/ubuntu gutsy-security main restricted
deb http://gb.archive.ubuntu.com/ubuntu/ gutsy universe
deb http://gb.archive.ubuntu.com/ubuntu/ gutsy-updates universe
deb http://security.ubuntu.com/ubuntu gutsy-security universe
deb http://gb.archive.ubuntu.com/ubuntu/ gutsy multiverse
deb-http://gb.archive.ubuntu.com/ubuntu/ gutsy-updates multiverse
deb http://security.ubuntu.com/ubuntu gutsy-security multiverse
1) Install Sun Java release 6 revision 3
sudo apt-get install sun-java6-jdk sun-java6-plugin
To test it point your browser at …
http://www.java.com/en/download/help/testvm.xml
Also, try these commands in a terminal. You should get something similar to the responses shown.
> java -version
java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing)
> javac -version
javac 1.6.0_03
> echo $JAVA_HOME
/usr/lib/jvm/java-6-sun
> echo $JDK_HOME
/usr/lib/jvm/java-6-sun
If necessary, the JAVA and JDK environmental variables can be set by adding the following lines to the top of the /etc/profile file.
pathmunge () {
if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then
if [ "$2" = "after" ] ; then
PATH=$PATH:$1
else
PATH=$1:$PATH
fi
fi
}
JAVA_HOME=/usr/lib/jvm/java-6-sun
pathmunge $JAVA_HOME/bin after
export JAVA_HOME
unset pathmunge
JDK_HOME="${JAVA_HOME}"
export JDK_HOME
To get the
/etc/profile to refresh the environmental variables without logging out, just use the following command:
2) Install Apache 2.2.4
sudo apt-get install apache2
To test this, point your browser at …
http://localhost
Also, try these commands in a terminal …
> man apachectl
(displays manual page)
> sudo apache2ctl fullstatus
(displays the ful status of the apache webserver)
> sudo apache2ctl start
(starts the apache webserver)
> sudo apache2ctl stop
(stops the apache webserver)
> sudo /etc/init.d/apache2 start
(another way to start the apache webserver)
> sudo /etc/init.d/apache2 stop
(and another way to stop it again)
3) Install MySQL 5.0.X
sudo apt-get install mysql-server mysql-client
To test the installation, try these commands in a terminal.
> ps aux | grep mysql
(shows running processes with "mysql" in their name)
> sudo /etc/init.d/mysql start
(starts the myql server)
> sudo /etc/init.d/mysql stop
(stops the myql server)
> mysql -u root -p
(requests to log in to running server as sqlroot, with the password given during installation)
mysql> show databases;
(shows that there is a 'test' database to play with; and the 'mysql' internal administrative database)
mysql> quit;
(leaves sql session)
> mysqladmin -u root shutdown
(shuts down the mysql server)
Note that typing …
> mysqladmin -u root password <password>
… will set or change the sqlroot password.
4) Install JBOSS 4.2.2.GA
First download jems-installer-1.2.0.GA.jar from the sourceforge page.
In the download directory type …
sudo java -jar jems-installer-1.2.0.GA.jar
After you've given your ubuntu password a graphic installer will start. You can accept most of the defaults; but these notes assume you install the jboss directory (not into /usr/local but into) into /opt. Also, after choosing your target installation directory, make sure you select "tomcat" on the next screen. The installation will inform you that Tomcat is a Servet 2.4 container profile, and that it is not J2EE 1.4 compatible. Don't worry; select "tomcat" then click "next". On the next screen, leave all the installation packs selected and click "next" to proceed, then accept the default of a standard installation on the screen that follows (the "standard" option just results in a simpler configuration which is fine for now).
The installation program will show that you're about to install into …
/opt/jboss-4.0.5.GA
and that you've chosen the installation packs …
jmx-core docs tomcat-client minimal xmlresolver jmx-console invokers-service jta-service usertx-service naming security war-deployer jboss-remoting xmlservice
On completion the terminal window will show …
PackageListener, install.log=/tmp/jems-install.log
calltarget:
chmod-bin:
[echo] Updating script executable modes
[echo] bin dir is /usr/local/jboss-4.0.5.GA/bin
calltarget:
jbossws14-post-install:
[echo] Unpacking wstools to bin...
[unzip] Expanding: /usr/local/jboss-4.0.5.GA/client/jbossws14-client.jar into /opt/jboss-4.0.5.GA/bin
[echo] jbossws14 done
You've now installed JBoss along with its built-in Tomcat servlet container. You can verify this by pointing your browser at …
http://localhost:8080/
You'll see a webpage giving links to JBoss Online Resources, and to various JBoss Management facilities on your local server …
* Tomcat status (full) (XML)
* JMX Console
* JBoss Web Console
Don't be alarmed that the last of these isn't yet installed ;)
Some handy commands are …
> ps ax | grep jboss
(shows whether jboss is running OK)
> sudo su -
switch to root
> cd /opt/jboss-4.0.5.GA/bin
change to the jboss binaries directory
> ./run.sh &
start jboss when root in /opt/jboss-4.0.5.GA/bin
> ./shutdown.sh -S
similarly, shutdown jboss
Note that this installation of JBoss will need to be restarted after a reboot.
6) Install Struts
First obtain struts-2.0.11-lib.zip
To develop applications with Struts, you can usually just add the Struts JAR file to your Java development environment. You can then start using the Struts classes as part of your own application.
The simplest way to install Struts is to copy a small Struts application, packed in "struts2-blank-2.0.11.war", from the download file to your Servlet container (that's /opt/jboss-4.0.5.GA/server/default/deploy if you've followed these instructions), then restart the Tomcat server.