<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Shuron's Letters&#187; JBoss</title>
	<atom:link href="http://alexander.holbreich.org/category/software/jboss/feed/" rel="self" type="application/rss+xml" />
	<link>http://alexander.holbreich.org</link>
	<description>Personal blog of Alexander Holbreich</description>
	<lastBuildDate>Tue, 25 May 2010 21:46:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>JBoss 5 GA on Debian linux</title>
		<link>http://alexander.holbreich.org/2010/01/java-jboss-debian-linux/</link>
		<comments>http://alexander.holbreich.org/2010/01/java-jboss-debian-linux/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 23:50:05 +0000</pubDate>
		<dc:creator>shuron</dc:creator>
				<category><![CDATA[JBoss]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[application server]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://alexander.holbreich.org?p=31</guid>
		<description><![CDATA[This short tutorial describes how to configure JBoss Application Server (Jboss GA 5.1.0) on a debian linux (Debian GNU/Linux 5.x &#8220;Lenny&#8221; ). Article starts with installation of java JDK and continues with JBoss installation and basic configuration according to standard  file system hierarchy. Also init.d. scripts configuration is given here.
Installing Java SDK
Nowadays  installing Java environment [...]]]></description>
			<content:encoded><![CDATA[<p>This short tutorial describes how to configure JBoss Application Server (Jboss GA 5.1.0) on a debian linux (Debian GNU/Linux 5.x &#8220;Lenny&#8221; ). Article starts with installation of java JDK and continues with JBoss installation and basic configuration according to standard  file system hierarchy. Also init.d. scripts configuration is given here.</p>
<h2>Installing Java SDK</h2>
<p>Nowadays  installing Java environment on Debian is an easy task. I used JDK 1.6. Don&#8217;t confound JDK with JRE, because bare Java Runtime Environment is not enough for running JBoss. Debian Wiki maintains (hope) a<a href="http://wiki.debian.org/Java" target="_blank"> list of available java .deb packages</a>, which are easily can be installed with your preferred way. I prefer <em>aptitude</em>, but <em>apt-get</em> of course works too.</p>
<pre class="brush: bash;">
$ aptitude install sun-java6-jdk
#or by good old apt-get.
$ apt-get install sun-java6-jdk
</pre>
<p>Installation is done after seconds. Now test your java installation with</p>
<pre class="brush: bash;">
$ java -version
# Here example result on my configuration:

java version &quot;1.6.0_12&quot;
Java(TM) SE Runtime Environment (build 1.6.0_12-b04)
Java HotSpot(TM) 64-Bit Server VM (build 11.2-b01, mixed mode)
</pre>
<p>If you get something like this, you&#8217;re done and your java should be already in the PATH.</p>
<h2>Installing JBoss AS</h2>
<p>Now let&#8217;s install  JBoss Application Server.</p>
<h3>Preparing</h3>
<p><a href="http://alexander.holbreich.org/wp-content/uploads/2010/01/openlogo-nd-50.png"><img class="alignleft size-full wp-image-500" style="margin-left: 15px; margin-right: 15px;" title="openlogo-nd-debian" src="http://alexander.holbreich.org/wp-content/uploads/2010/01/openlogo-nd-50.png" alt="" width="50" height="61" /></a>Normally you are not willing  to start services (especially when they are accessed from outher machines) with root privileges. Therefore we have to define new user and group which will be used to manage JBoss.  So next line will create new group and new user with this group.</p>
<pre class="brush: bash;">
 $ groupadd jboss
 $ useradd -s /bin/bash -d /home/jboss -m -g jboss jboss
</pre>
<p>This jboss user has no password, so nobody can login with this username. If you consider to  login with jboss user,  password has to be set. Use <em>passwd jboss</em> command for that.</p>
<h3>Download, Installation,  filesystem layout</h3>
<p>Now  download desired Jboss version. I started with JBoss 5.1.0 GA, which can be download with:</p>
<pre class="brush: bash;">
$ cd /tmp # swithch to temp dir
$ wget http://sourceforge.net/projects/jboss/files/JBoss/JBoss-5.1.0.GA/jboss-5.1.0.GA.zip/download
</pre>
<p>Check also the whole <a href="http://labs.jboss.com/jbossas/downloads/" target="_blank">list of verisons</a> if interested. As you may noticed JBoss binaries are packaged with ZIP. So it is comfortable to use<em> unzip</em> tool. Maybe you have to install it first.</p>
<p>But before you extract  downloaded file, we have to decide, where exactly should JBoss files be placed on a  file-system. Unfortunately JBoss is not quite conform to Linux <a href="http://proton.pathname.com/fhs/pub/fhs-2.3.html" target="_blank">File System Hierarchy Standard</a> per default, so there are many possibilities for a location configuration. Some of you may want to place JBoss  into <em>/opt</em> directory. But I prefer to split the installation a little bit and  want to start by putting  JBoss core files in <em>/usr/local/,</em> where local, unchangeable and read-only files usually placed. E.g. I use  /usr/local/jboss/510 as JBoss 5.1.0 GA root.  So let&#8217;s create that location and extract files into it.</p>
<pre class="brush: bash;">
mkdir /usr/local/jboss #create new jboss directroy
chown jboss:jboss /usr/local/jboss #now its belongs touser jboss and group jboss
su jboss
mkdir /usr/local/jboss/510
cd /usr/local/jboss/510
unzip /tmp/jboss-5.1.0.GA.zip
</pre>
<p>At this moment you should have new working JBoss. If you want, test it with</p>
<pre class="brush: bash;">
bin/run.sh -b 0.0.0.0
</pre>
<p>Where<em> -b 0.0.0.0 </em>means that JBoss is listening for every ip address of current machine.</p>
<p>However at this stage the installed Jboss still brakes the  Linux Filesystem Hierarchy Standard, so let&#8217;s improve this situation.</p>
<p><span id="more-31"></span>After the first start of the server used configuration will have new directories <em>/tmp</em> and <em>/work</em> . The /tmp directory contain the temporarily state of the deployed applications and /work is contains compiled jsp pages of deployed applications. Therefore both directories are of temporal character and  should be on more appropriate place according to Linux standards.</p>
<p>I use only a default JBoss configuration,  which is defined under <em>&lt;jboss_root&gt;/server/default</em>, so I need to do further changes only for this configuration. My decision is to put both directories to /var /tmp/jboss.:</p>
<pre class="brush: bash;">
$ mkdir /var/tmp/jboss
$ chown jboss:jboss /var/tmp/jboss/
$ su jboss
$ mkdir /var/tmp/jboss/510
$ mkdir /var/tmp/jboss/510/tmp # creating alternavtive location for tmp
$ mkdir /var/tmp/jboss/510/work # creating alternavtive location for work
$ cd /usr/local/jboss/510/server/default # switch to configuration directory if not allready here.
$ rm -R tmp # delete existing tmp directory (server should not run at this moment)
$ rm -R work # delete existing work directory
$ ln -s /var/tmp/jboss/510/tmp ./tmp # Finaly create symbolic link to new place$
$ ln -s /var/tmp/jboss/510/work ./work # Finaly create symbolic link to new place
</pre>
<p>repeat the same for /log directory. It is common to have logs at one place in /var/log<br />
create a log directory tree e.g. /var/log/jboss/510/ and let log link to it as was shown for tmp and work directories.</p>
<p>After that your configuration directory should look like:</p>
<pre class="brush: bash;">
$ ls -l /usr/local/jboss/510/server/default
drwxr-xr-x  6 jboss jboss 4096 22. Mai 2009  conf
drwxr-xr-x  6 jboss jboss 4096 23. Jan 00:10 data
drwxr-xr-x 15 jboss jboss 4096 22. Mai 2009  deploy
drwxr-xr-x 12 jboss jboss 4096 22. Mai 2009  deployers
drwxr-xr-x  2 jboss jboss 4096 22. Mai 2009  lib
lrwxrwxrwx  1 jboss jboss   19 23. Jan 01:07 log -&gt; /var/log/jboss/510/
lrwxrwxrwx  1 jboss jboss   23 23. Jan 01:13 tmp -&gt; /var/tmp/jboss/510/tmp/
lrwxrwxrwx  1 jboss jboss   24 23. Jan 01:13 work -&gt; /var/tmp/jboss/510/work/
</pre>
<p>And your logs are of course accessible directly at new location e.g.</p>
<pre class="brush: bash;">
tail -1000f /var/log/jboss/510/server.log
</pre>
<p>Furthermore you should deploy your applications to /srv/jboss/510 to enable this location for automatically scan and deployment,just create a link from /default/deploy/. Call it e.g. applications.:</p>
<pre class="brush: bash;">
$ ln -s /srv/jboss/510 ./usr/local/jboss/510/server/default/deploy/applications #
</pre>
<p>So applications which are placed to /srv/jboss/510 will be automatically deployed on the server.</p>
<h3>Start JBoss on boot</h3>
<p>First of all you need a life-cycle management script used by <em>init</em>. Jboss already provides some of then.  Let&#8217;s use one of Red Hat default script by adopting it a little bit. First of all copy the script to common place (feel free to ad version ti scriptname if you need or like)</p>
<pre class="brush: bash;">
$ cp /usr/local/jboss/bin/jboss_init_redhat.sh /etc/init.d/jboss
</pre>
<p>If you want to access you fresh JBoss also from other IP addresses you need to change<br />
JBOSS_HOST line according to:</p>
<pre class="brush: bash;">
JBOSS_BIND_ADDR=${JBOSS_HOST:-&quot;-b 0.0.0.0&quot;}.
</pre>
<p>0.0.0.0. binds it on all IP addresses. Consider to change also other param this file to mach your personal needs. Now you can automatically create all the symbolic links used by <em>init</em> service.</p>
<pre class="brush: bash;">

$ update-rc.d jboss defaults
</pre>
<p>Now your Jboss will  start automatically after reboot&#8230;</p>
<h3>Additional configuration</h3>
<ul>
<li><em>&lt;jboss_root&gt;/bin/run.conf</em> file configures the start parameters of the server. Maybe default limits are not suitable for your applications. So check it.</li>
<li>Under <em>&lt;jboss_root&gt;/server/default/conf</em> you will find some configuration files of the default server configuration. One of the interesting is of course <em>jboss-lo4j.xml</em>, where you can precisely define logging processing.</li>
</ul>
<h3>Questions &amp; Suggestions</h3>
<p>Thank you for reading this. Please feel free to provide any suggestions to the topic of JBoss installation on Linux and specially on Debian. Of course your questions are welcome too!</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Falexander.holbreich.org%2F2010%2F01%2Fjava-jboss-debian-linux%2F&amp;title=JBoss%205%20GA%20on%20Debian%20linux&amp;bodytext=This%20short%20tutorial%20describes%20how%20to%20configure%20JBoss%20Application%20Server%20%28Jboss%20GA%205.1.0%29%20on%20a%20debian%20linux%20%28Debian%20GNU%2FLinux%205.x%20%22Lenny%22%20%29.%20Article%20starts%20with%20installation%20of%20java%20JDK%20and%20continues%20with%20JBoss%20installation%20and%20basic%20configuration%20acc" title="Digg"><img src="http://alexander.holbreich.org/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Falexander.holbreich.org%2F2010%2F01%2Fjava-jboss-debian-linux%2F&amp;title=JBoss%205%20GA%20on%20Debian%20linux&amp;notes=This%20short%20tutorial%20describes%20how%20to%20configure%20JBoss%20Application%20Server%20%28Jboss%20GA%205.1.0%29%20on%20a%20debian%20linux%20%28Debian%20GNU%2FLinux%205.x%20%22Lenny%22%20%29.%20Article%20starts%20with%20installation%20of%20java%20JDK%20and%20continues%20with%20JBoss%20installation%20and%20basic%20configuration%20acc" title="del.icio.us"><img src="http://alexander.holbreich.org/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Falexander.holbreich.org%2F2010%2F01%2Fjava-jboss-debian-linux%2F&amp;t=JBoss%205%20GA%20on%20Debian%20linux" title="Facebook"><img src="http://alexander.holbreich.org/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.mixx.com/submit?page_url=http%3A%2F%2Falexander.holbreich.org%2F2010%2F01%2Fjava-jboss-debian-linux%2F&amp;title=JBoss%205%20GA%20on%20Debian%20linux" title="Mixx"><img src="http://alexander.holbreich.org/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Falexander.holbreich.org%2F2010%2F01%2Fjava-jboss-debian-linux%2F&amp;title=JBoss%205%20GA%20on%20Debian%20linux&amp;annotation=This%20short%20tutorial%20describes%20how%20to%20configure%20JBoss%20Application%20Server%20%28Jboss%20GA%205.1.0%29%20on%20a%20debian%20linux%20%28Debian%20GNU%2FLinux%205.x%20%22Lenny%22%20%29.%20Article%20starts%20with%20installation%20of%20java%20JDK%20and%20continues%20with%20JBoss%20installation%20and%20basic%20configuration%20acc" title="Google Bookmarks"><img src="http://alexander.holbreich.org/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http%3A%2F%2Falexander.holbreich.org%2F2010%2F01%2Fjava-jboss-debian-linux%2F&amp;Title=JBoss%205%20GA%20on%20Debian%20linux" title="BlinkList"><img src="http://alexander.holbreich.org/wp-content/plugins/sociable/images/blinklist.png" title="BlinkList" alt="BlinkList" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.mister-wong.de/addurl/?bm_url=http%3A%2F%2Falexander.holbreich.org%2F2010%2F01%2Fjava-jboss-debian-linux%2F&amp;bm_description=JBoss%205%20GA%20on%20Debian%20linux&amp;plugin=soc" title="MisterWong.DE"><img src="http://alexander.holbreich.org/wp-content/plugins/sociable/images/misterwong.png" title="MisterWong.DE" alt="MisterWong.DE" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://slashdot.org/bookmark.pl?title=JBoss%205%20GA%20on%20Debian%20linux&amp;url=http%3A%2F%2Falexander.holbreich.org%2F2010%2F01%2Fjava-jboss-debian-linux%2F" title="Slashdot"><img src="http://alexander.holbreich.org/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Falexander.holbreich.org%2F2010%2F01%2Fjava-jboss-debian-linux%2F&amp;title=JBoss%205%20GA%20on%20Debian%20linux" title="StumbleUpon"><img src="http://alexander.holbreich.org/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Falexander.holbreich.org%2F2010%2F01%2Fjava-jboss-debian-linux%2F" title="Technorati"><img src="http://alexander.holbreich.org/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Falexander.holbreich.org%2F2010%2F01%2Fjava-jboss-debian-linux%2F&amp;h=JBoss%205%20GA%20on%20Debian%20linux" title="NewsVine"><img src="http://alexander.holbreich.org/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Falexander.holbreich.org%2F2010%2F01%2Fjava-jboss-debian-linux%2F&amp;title=JBoss%205%20GA%20on%20Debian%20linux" title="Reddit"><img src="http://alexander.holbreich.org/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://yigg.de/neu?exturl=http%3A%2F%2Falexander.holbreich.org%2F2010%2F01%2Fjava-jboss-debian-linux%2F&amp;exttitle=JBoss%205%20GA%20on%20Debian%20linux" title="Yigg"><img src="http://alexander.holbreich.org/wp-content/plugins/sociable/images/yiggit.png" title="Yigg" alt="Yigg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Falexander.holbreich.org%2F2010%2F01%2Fjava-jboss-debian-linux%2F&amp;t=JBoss%205%20GA%20on%20Debian%20linux" title="HackerNews"><img src="http://alexander.holbreich.org/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Falexander.holbreich.org%2F2010%2F01%2Fjava-jboss-debian-linux%2F&amp;title=JBoss%205%20GA%20on%20Debian%20linux&amp;source=Shuron%27s+Letters+Personal+blog+of+Alexander+Holbreich&amp;summary=This%20short%20tutorial%20describes%20how%20to%20configure%20JBoss%20Application%20Server%20%28Jboss%20GA%205.1.0%29%20on%20a%20debian%20linux%20%28Debian%20GNU%2FLinux%205.x%20%22Lenny%22%20%29.%20Article%20starts%20with%20installation%20of%20java%20JDK%20and%20continues%20with%20JBoss%20installation%20and%20basic%20configuration%20acc" title="LinkedIn"><img src="http://alexander.holbreich.org/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.webnews.de/einstellen?url=http%3A%2F%2Falexander.holbreich.org%2F2010%2F01%2Fjava-jboss-debian-linux%2F&amp;title=JBoss%205%20GA%20on%20Debian%20linux" title="Webnews.de"><img src="http://alexander.holbreich.org/wp-content/plugins/sociable/images/webnews.png" title="Webnews.de" alt="Webnews.de" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Falexander.holbreich.org%2F2010%2F01%2Fjava-jboss-debian-linux%2F&amp;submitHeadline=JBoss%205%20GA%20on%20Debian%20linux&amp;submitSummary=This%20short%20tutorial%20describes%20how%20to%20configure%20JBoss%20Application%20Server%20%28Jboss%20GA%205.1.0%29%20on%20a%20debian%20linux%20%28Debian%20GNU%2FLinux%205.x%20%22Lenny%22%20%29.%20Article%20starts%20with%20installation%20of%20java%20JDK%20and%20continues%20with%20JBoss%20installation%20and%20basic%20configuration%20acc&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://alexander.holbreich.org/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://alexander.holbreich.org/2010/01/java-jboss-debian-linux/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
