Pages

Tuesday, April 20, 2010

Jboss-4.0.2 Application Server in Solaris 10

1 Jboss-4.0.2 Application Server in Solaris 10
1.1 Directory structure
1.2 Check pre condition
Check the disk space in /apps to make sure that it still have enough space for installation. ( put the JBoss folder inside /apps folder)

# bash
bash-3.00# df -h /apps

Filesystem size used avail capacity Mounted on
       /dev/dsk/c0d0s0 7.7G 3.7G 3.9G 49% /

1.3 Installation
1.3.1 Unzip the JBoss file to /apps folder:

bash-3.00# unzip /Desktopjboss-4.0.2.zip -d /apps/
Wait until the unzip process is finished. Then the JBoss folder (jboss-4.0.2.zip) should be exist in the /apps folder.

To verify the folder I type this command:
bash-3.00# ls -la
/apps/ drwxr-xr-x 6 root sys 512 Apr 20 21:12 .
drwxr-xr-x 41 root root 1024 Apr 20 20:16 ..
drwxr-xr-x 3 root bin 512 Apr 12 13:20 SUNWits
drwxr-xr-x 4 root bin 512 Apr 12 13:35 SUNWmlib
drwxr-xr-x 8 root root 512 Dec 4 21:28
jboss-4.0.2.zip.zip drwxr-xr-x 8 root root 512 Apr 12 13:45 staroffice8
bash-3.00#

1.4 Start Web Servewr
1.4.1 Start (run) the JBoss AS:
bash-3.00# cd /apps/jboss-4.0.2/bin/
bash-3.00# sh run.sh –c default

By default JBoss will use port 8080. If your port is conflict with other web server, you can change the JBoss port number to something else. Now, I open the browser then type in:

http://localhost:8080 or http://192.168.1.IP:8080

1.4.2 Stop (shutdown) the JBoss:
bash-3.00# cd /apps/jboss-4.0.2/bin/
bash-3.00# ./shutdown.sh –s
or
if started as a service
bash-3.00# sh shutdown.sh -s 127.0.0.1 -S
Server shutdown may take a while - check logfiles for completion

1.4.3 Delete work and tmp folders inside following folder
bash-3.00# cd /apps/jboss-4.0.2/server/default/
bash-3.00# rm –r tmp work


1.5 Deployment Web Application in jboss-4.0.2
1.5.1 Deploy web application in JBoss AS.
To deploy the web application, just copy the icard.war file to the /apps/jboss-4.0.2/server/default/deploy folder:
To verify that the file is copied successfully, use this command:
bash-3.00# cd /apps/jboss-4.0.2/server/default/deploy
bash-3.00# ls -la | grep war

drwxr-xr-x 6 root root 512 Dec 4 17:23 ROOT.war
drwxr-xr-x 6 root root 512 Dec 4 17:23 jmx-console.war
-rw-r--r-- 1 root root 4157406 Apr 21 12:30 Application_name.war

1.5.2 Start the application server:
bash-3.00# cd /apps/jboss-4.0.2/bin/
bash-3.00# sh run.sh –c default
or
bash-3.00# /apps/jboss-4.0.2/bin/run.sh -b 127.0.0.1

During the JBoss AS is running, it will automatically deploy the war file. Notice this message in the JBoss console: 13:40:37,159 INFO [TomcatDeployment] deploy, ctxPath=/icard, vfsUrl=icard.war

1.5.3 Application dependencies
If there is application dependencies put inside /server/default/libs folder

1.5.5 Enabling login module for jboss
1.5.5.1 jboss-web.xml 
bash-3.00# cd /apps/ jboss-4.0.2/server/default/deploy/jmx-console.war/WEB-INF/
bash-3.00# vi jboss-web.xml

Uncomment following
< -- Uncomment the security-domain to enable security. You will need to edit the html adaptor login configuration to setup the login modules used to authentication users. java:/jaas/jmx-console -- >

1.5.5.2 Web.xml - Jass enable 
bash-3.00# cd /apps/ jboss-4.0.2/server/default/deploy/jmx-console.war/WEB-INF/
bash-3.00# vi Web.xml Uncomment following

HtmlAdaptor An example security config that only allows users with the role JBossAdmin to access the HTML JMX console web application /* GET POST JBossAdmin -- >

1.5.5.3 User name, password and user roles
bash-3.00# cd /apps/jboss-4.0.2/server/default/conf/props
Edit jmx-console-roles.properties and jmx-console-users.properties

1.5.5.4 Start web application.
Now open the browser and type in http://192.168.1.IP:8080/Application_name/


1.5.6 To remove the web Application
What we need to do is just delete the war file. It can be done during the server is running or server is offline. Suppose here, the JBoss AS is running.

To remove the web application:
bash-3.00# cd /apps/jboss-4.0.2/server/default/deploy
bash-3.00# rm -rf Application_name.war

After deletion, in the JBoss console will automatically remove this web application. 13:42:57,274 INFO [TomcatDeployment] undeploy, ctxPath=/icard, vfsUrl=icard.war