
At work, we currently have deployed apps that run on JBoss under Windows 2003. No big deal really, apart from other services on the Windows servers tend to kill the entire box now and again - quite a pain in the backside. So I’m trying to convince them to move to a more stable OS, that being FreeBSD.
I documented the whole thing (as you should), so here is my guide to installing and configuing JBoss4 on a fresh install of FreeBSD
Before we start, we’d better check we have all the requirements:
- FreeBSD 6.2 installed and ready to rock
- A root login account
- SFTP / FTP access to the server
First we’d better update our ports quickly. We need to make sure we’re getting the most up to date sources:
portsnap fetch
portsnap update
Obviously JBoss is a Java application server, so common sense would say we need to install Java first. According to RedHat, the latest JBoss releases (4.2) only need the JRE (runtime environment) to run, but on FreeBSD that isn’t the case - it still wants to JDK (development kit) so lets install that:
cd /usr/ports/java/diablo-jdk15 && make install clean
But you’ll find that complains:
===> diablo-jdk-1.5.0.07.01_7 :
Because of licensing restrictions, you must fetch the distribution
manually.
Please accesshttp://www.FreeBSDFoundation.org/cgi-bin/download?download=diablo-caffe-freebsd6-i386-
1.5.0_07-b01.tar.bz2
with a web browser and “Accept” the End User License Agreement for
“Caffe Diablo 1.5.0″. Please place the downloaded
diablo-caffe-freebsd6-i386-1.5.0_07-b01.tar.bz2 in /usr/ports/distfiles.Please open http://java.sun.com/javase/downloads/index.jsp
in a web browser and follow the “Download” link for
“JDK US DST Timezone Update Tool - 1.2.2″ to obtain the
time zone update file, tzupdater-1_2_2-2007g.zip..*** Error code 1
Stop in /usr/ports/java/diablo-jdk15.
Ok, so we need to get the files manually. The first file is easy to pick up. The Timezone update is not as you are forced to register an account with Sun. No biggie really, just a bit of a pain.
FTP/SFTP these two files to your /usr/ports/distfiles and we’re ready to continue:
cd /usr/ports/java/diablo-jdk15 && make install clean
Make sure you enable the TZUPDATE option. This took about 15 minutes on my box, but might take longer on yours. Go get something to eat or get a coffee.
If that suceeded, then you’re already half way there! Now it’s time to actually install JBoss itself……
cd /usr/ports/java/jboss4 && make install clean
Wait for that to build.
There’s a couple of configuration changes you’ll need to make if you want it to a.Work b.Work on the network.
Edit /usr/local/jboss4/bin/run.conf and setup the JAVA_HOME variable to equal “/usr/local/diablo-jdk1.5.0/” so it can find Java where FreeBSD installs it. In this file you can also add extra classpaths, configure memory allocations etc.
Out of the box, JBoss uses port 8080. To change that, edit the file /usr/local/jboss4/server/default/deploy/http-invoker.sar/META-INF/jboss-service.xml
Search for 8080 and replace it with whatever port number you want to use.
Starting JBoss is simple:
/usr/local/jboss4/bin/run.sh
Starting JBoss binded to an ip other that 127.0.0.1 is simple also:
/usr/local/jboss4/bin/run.sh -b 192.168.0.1 (or whatever ip you’re using)
July 15th, 2008 at 3:47 pm
Hi,
I have got a question regarding the installation of the jboss app server.
Why did you choose the diable-sdk instead of the /java/jdk15 port?
TIA,
Etienne.
September 1st, 2008 at 5:07 pm
Hi Etienne,
1)read first page at http://www.freebsdfoundation.org/downloads/java.shtml
2)jboss depends on diablo-jdk http://www.freshports.org/java/jboss5/
March 4th, 2009 at 2:56 pm
Nice article ..
Thank you very much…