MIGRATED-PAGES‎ > ‎

Fine Tuning JBoss Application Server(MIGRATED)

http://wavelet.asia/customer-portal/?p=7529

To fine tune JBoss Application Server, there are a few areas to be covered as below:

 

1. Redirecting root context

By the default, the jboss root context allows any user to configure the JBoss Application Server through the JMX console. This is extremely undesirable and extremely dangerous.

 

First, create the redirector:

 

#vi ~/index.html

 

and paste the following inside.

 

<html>

  <head>

    <meta http-equiv="refresh" content="0;URL=http://www.wavelet.biz"/>

  </head>

</html>

 

 

Then,

 

# cd /jboss/server/default/deploy/jbossweb-tomcat50.sar/ROOT.war/index.html  /jboss/server/default/deploy/jbossweb-tomcat50.sar/ROOT.war/index.html-original

# cp ~/index.html /jboss/server/default/deploy/jbossweb-tomcat50.sar/ROOT.war/index.html

 

 

2. Java Virtual Machine Memory Size

To increase the memory size for JBoss app server.... only 2 lines, take about 15 seconds. Modify the part highlighted in RED.

 
 

[root@localhost bin]# vi /usr/java/jboss/bin/run.conf

#
# Specify options to pass to the Java VM.
#
if [ "x$JAVA_OPTS" = "x" ]; then
   JAVA_OPTS="-server -Xms128m -Xmx1024m "
fi

 

 

3. Upgrade J2SDK

 

[root@localhost java]# wget http://server.wavelet.biz/downloads/j2sdk1.4.2_12.tar.gz
--21:51:07--  http://server.wavelet.biz/downloads/j2sdk1.4.2_12.tar.gz
Resolving server.wavelet.biz... 202.190.198.151
Connecting to server.wavelet.biz|202.190.198.151|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 43887017 (42M) [application/x-gzip]
Saving to: `j2sdk1.4.2_12.tar.gz'

100%[===========================================================>] 43,887,017   146K/s   in 5m 44s

21:56:51 (125 KB/s) - `j2sdk1.4.2_12.tar.gz' saved [43887017/43887017]

[root@localhost java]# ls
j2re1.4.1_03  j2sdk1.4.1_02         j2sdkee     jakarta-ant      javacomm     jboss
j2sdk         j2sdk1.4.2_12.tar.gz  j2sdkee1.4  jakarta-ant-1.5  java.tar.gz  jboss-4.0.1RC2
[root@localhost java]# gunzip j2sdk1.4.2_12.tar.gz
[root@localhost java]# tar xvf j2sdk1.4.2_12.tar
j2sdk1.4.2_12/
j2sdk1.4.2_12/include/
j2sdk1.4.2_12/include/jni.h
j2sdk1.4.2_12/include/jvmpi.h
.
.
.
.
j2sdk1.4.2_12/jre/README
j2sdk1.4.2_12/jre/THIRDPARTYLICENSEREADME.txt
[root@localhost java]# ls
j2re1.4.1_03   j2sdk1.4.2_12      j2sdkee1.4       javacomm     jboss-4.0.1RC2
j2sdk          j2sdk1.4.2_12.tar  jakarta-ant      java.tar.gz
j2sdk1.4.1_02  j2sdkee            jakarta-ant-1.5  jboss
[root@localhost java]# ls -l
total 333380
drwxr-xr-x  6 root  root         4096 Jun  6  2003 j2re1.4.1_03
lrwxrwxrwx  1 root  vincent        16 Mar  8 11:23 j2sdk -> ./j2sdk1.4.1_02/
drwxr-xr-x  9 root  vincent      4096 Apr 20  2003 j2sdk1.4.1_02
drwxrwxr-x  9 root  root         4096 Aug  9  2006 j2sdk1.4.2_12
-rw-r--r--  1 root  root     93726720 Jan 21 12:08 j2sdk1.4.2_12.tar
lrwxrwxrwx  1 root  vincent        13 Mar  8 11:23 j2sdkee -> ./j2sdkee1.4/
drwxr-xr-x 18 root  vincent      4096 Apr 20  2003 j2sdkee1.4
lrwxrwxrwx  1 root  vincent                   18 Mar  8 11:23 jakarta-ant -> ./jakarta-ant-1.5/

drwxr-xr-x  6 root  vincent      4096 Apr 20  2003 jakarta-ant-1.5
drwxr-xr-x  2 root  root         4096 May  2  2003 javacomm
-rw-r--r--  1 root  root    247223889 Apr 26 05:06 java.tar.gz
lrwxrwxrwx  1 root  root           17 Mar  8 11:23 jboss -> ./jboss- 4.0.1RC2/
drwxrwxr-x  7 admin admin        4096 Jan  4  2005 jboss-4.0.1RC2
[root@localhost java]# rm j2sdk
rm: remove symbolic link `j2sdk'? y
[root@localhost java]# ln -s ./j2sdk1.4.2_12 j2sdk
[root@localhost java]# ls -l
total 333380
drwxr-xr-x  6 root  root         4096 Jun  6  2003 j2re1.4.1_03
lrwxrwxrwx  1 root  root           15 Apr 26 22:04 j2sdk -> ./j2sdk1.4.2_12
drwxr-xr-x  9 root  vincent      4096 Apr 20  2003 j2sdk1.4.1_02
drwxrwxr-x  9 root  root         4096 Aug  9  2006 j2sdk1.4.2_12
-rw-r--r--  1 root  root     93726720 Jan 21 12:08 j2sdk1.4.2_12.tar
lrwxrwxrwx  1 root  vincent        13 Mar  8 11:23 j2sdkee -> ./j2sdkee1.4/
drwxr-xr-x 18 root  vincent      4096 Apr 20  2003 j2sdkee1.4
lrwxrwxrwx  1 root  vincent        18 Mar  8 11:23 jakarta-ant -> ./jakarta-ant-1.5/
drwxr-xr-x  6 root  vincent      4096 Apr 20  2003 jakarta-ant-1.5
drwxr-xr-x  2 root  root         4096 May  2  2003 javacomm
-rw-r--r--  1 root  root    247223889 Apr 26 05:06 java.tar.gz
lrwxrwxrwx  1 root  root           17 Mar  8 11:23 jboss -> ./jboss- 4.0.1RC2/
drwxrwxr-x  7 admin admin        4096 Jan  4  2005 jboss-4.0.1RC2

 

4. Modifying JBoss listening port

By default JBoss listens to port 8080, if you would like to change the port for some reasons (other applications are using port 8080 etc), you can change the following file:

 

/usr/java/jboss/server/default/deploy/jbossweb-tomcat50.sar/server.xml

 

Edit the following portion accordingly:

 

      <Connector port="8080" address="${jboss.bind.address}"

         maxThreads="150" minSpareThreads="25" maxSpareThreads="75"

         enableLookups="false" redirectPort="8443" acceptCount="100"

         connectionTimeout="20000" disableUploadTimeout="true"/>

 

 

 

 

Comments