Cara pasang JBOSS 5.1.2 secara default pada pemasangan Centos 6.5.
19- Untuk Setting mod_jk, jsvc, https boleh rujuk :-
http://catatan-khairi.blogspot.com/2013/11/install-tomcat-7-pada-redhat-64.html
20;- Boleh jimatkan ruang untuk fail sistem dengan pindah fail aplikasi Jboss ke nfs yang telah di mount ke /data (contohnya).
#mv /opt/jboss /data/.
#cd /data/sys/pos1/jboss/jboss-as/
#mv tmp work /opt/jboss/.
#cd /opt/jboss/
# ln -s work tmp /data/sys/pos1/jboss/jboss-as/.
yum -y install vim htop iptraf yum-security yum-presto
1- #ifup eth0
-Seperti yang ada terbina dalam firewall akan menghalang semua permintaan kepada pelayan web baru anda (kecuali OpenSSH) jadi buat sementara benarkan semua akses daripada IPADDRESS anda.
#iptables -I INPUT -s "YOURIP" -j ACCEPT
atau
#Disable selinux dan /etc/init.d/iptables stop
2-Pasang Oracle java http://catatan-khairi.blogspot.com/2014/06/install-jdk-6-pada-centos6.html
-check Versi Java yang digunakan
#java -version
#vim /opt/jboss/jboss-as/server/production/log/boot.log
#chkconfig network on
#yum -y update
-Seperti yang ada terbina dalam firewall akan menghalang semua permintaan kepada pelayan web baru anda (kecuali OpenSSH) jadi buat sementara benarkan semua akses daripada IPADDRESS anda.
#iptables -I INPUT -s "YOURIP" -j ACCEPT
atau
#Disable selinux dan /etc/init.d/iptables stop
2-Pasang Oracle java http://catatan-khairi.blogspot.com/2014/06/install-jdk-6-pada-centos6.html
-check Versi Java yang digunakan
#java -version
#vim /opt/jboss/jboss-as/server/production/log/boot.log
2- java -jar jboss-eap-5.2.jar atau unzip jboss-eap-5.2.zip
3- Kalau unzip
#mv jboss-eap-5.2 /opt/jboss
#mv jboss-eap-5.2 /opt/jboss
4- useradd jboss
5- Buat skrip pemula
#cp /opt/jboss/jboss-as/bin/jboss_init_redhat.sh /etc/init.d/jboss
6-vim jboss ( BUAT jadi macam ini)
#!/bin/sh
#
# $Id: jboss_init_redhat.sh 90717 2009-06-30 23:04:46Z smarlow@redhat.com $
#
# JBoss Control Script
#
# chkconfig: - 85 15
# description: JBoss Application Server
# processname: jboss
#
# To use this script run it as root - it will switch to the specified user
#
# Here is a little (and extremely primitive) startup/shutdown script
# for RedHat systems. It assumes that JBoss lives in /usr/local/jboss,
# it's run by user 'jboss' and JDK binaries are in /usr/local/jdk/bin.
# All this can be changed in the script itself.
#
# Either modify this script for your requirements or just ensure that
# the following variables are set correctly before calling the script.
#define where jboss is - this is the directory containing directories log, bin, conf etc
JBOSS_HOME=${JBOSS_HOME:-"/opt/jboss/jboss-as"}
#define the user under which jboss will run, or use 'RUNASIS' to run as the current user
JBOSS_USER=${JBOSS_USER:-"jboss"}
#make sure java is in your path
JAVAPTH=${JAVAPTH:-"/usr/java/default/bin"}
#configuration to use, usually one of 'minimal', 'default', 'all'
JBOSS_CONF=${JBOSS_CONF:-"production"}
#if JBOSS_HOST specified, use -b to bind jboss services to that address
JBOSS_HOST=`ifconfig|grep 'inet addr:'|grep -v '127.0.0.1'|cut -d: -f2|awk 'NR==1{print $1}'`
JBOSS_BIND_ADDR=${JBOSS_HOST:+"-b $JBOSS_HOST"}
#!/bin/sh
#
# $Id: jboss_init_redhat.sh 90717 2009-06-30 23:04:46Z smarlow@redhat.com $
#
# JBoss Control Script
#
# chkconfig: - 85 15
# description: JBoss Application Server
# processname: jboss
#
# To use this script run it as root - it will switch to the specified user
#
# Here is a little (and extremely primitive) startup/shutdown script
# for RedHat systems. It assumes that JBoss lives in /usr/local/jboss,
# it's run by user 'jboss' and JDK binaries are in /usr/local/jdk/bin.
# All this can be changed in the script itself.
#
# Either modify this script for your requirements or just ensure that
# the following variables are set correctly before calling the script.
#define where jboss is - this is the directory containing directories log, bin, conf etc
JBOSS_HOME=${JBOSS_HOME:-"/opt/jboss/jboss-as"}
#define the user under which jboss will run, or use 'RUNASIS' to run as the current user
JBOSS_USER=${JBOSS_USER:-"jboss"}
#make sure java is in your path
JAVAPTH=${JAVAPTH:-"/usr/java/default/bin"}
#configuration to use, usually one of 'minimal', 'default', 'all'
JBOSS_CONF=${JBOSS_CONF:-"production"}
#if JBOSS_HOST specified, use -b to bind jboss services to that address
JBOSS_HOST=`ifconfig|grep 'inet addr:'|grep -v '127.0.0.1'|cut -d: -f2|awk 'NR==1{print $1}'`
JBOSS_BIND_ADDR=${JBOSS_HOST:+"-b $JBOSS_HOST"}
#Clustering
JBOSS_PARTITION="cluster1"
JBOSS_PEERID=`echo $JBOSS_HOST|cut -d. -f4`
JBOSS_CLUSTER=${JBOSS_PARTITION:+"-g $JBOSS_PARTITION -Djboss.messaging.ServerPeerID=$JBOSS_PEERID -DjvmRoute=node$JBOSS_PEERID"}
#define the classpath for the shutdown class
JBOSSCP=${JBOSSCP:-"$JBOSS_HOME/bin/shutdown.jar:$JBOSS_HOME/client/jnet.jar"}
#define the script to use to start jboss
JBOSSSH=${JBOSSSH:-"/bin/sh $JBOSS_HOME/bin/run.sh -c $JBOSS_CONF $JBOSS_BIND_ADDR $JBOSS_CLUSTER"}
if [ "$JBOSS_USER" = "RUNASIS" ]; then
SUBIT=""
else
SUBIT="su - $JBOSS_USER -s /bin/sh -c "
fi
if [ -n "$JBOSS_CONSOLE" -a ! -d "$JBOSS_CONSOLE" ]; then
# ensure the file exists
touch $JBOSS_CONSOLE
if [ ! -z "$SUBIT" ]; then
chown $JBOSS_USER $JBOSS_CONSOLE
fi
fi
if [ -n "$JBOSS_CONSOLE" -a ! -f "$JBOSS_CONSOLE" ]; then
echo "WARNING: location for saving console log invalid: $JBOSS_CONSOLE"
echo "WARNING: ignoring it and using /dev/null"
JBOSS_CONSOLE="/dev/null"
fi
#define what will be done with the console log
JBOSS_CONSOLE=${JBOSS_CONSOLE:-"/dev/null"}
JBOSS_CMD_START="cd $JBOSS_HOME/bin; $JBOSSSH"
JBOSS_CMD_STOP=${JBOSS_CMD_STOP:-"java -classpath $JBOSSCP org.jboss.Shutdown --shutdown -s $JBOSS_HOST -u admin -p password"}
if [ -z "`echo $PATH | grep $JAVAPTH`" ]; then
export PATH=$PATH:$JAVAPTH
fi
if [ ! -d "$JBOSS_HOME" ]; then
echo JBOSS_HOME does not exist as a valid directory : $JBOSS_HOME
exit 1
fi
case "$1" in
start)
echo JBOSS_CMD_START = $JBOSS_CMD_START
cd $JBOSS_HOME/bin
if [ -z "$SUBIT" ]; then
eval $JBOSS_CMD_START >${JBOSS_CONSOLE} 2>&1 &
else
$SUBIT "$JBOSS_CMD_START >${JBOSS_CONSOLE} 2>&1 &"
fi
;;
stop)
echo JBOSS_CMD_STOP = $JBOSS_CMD_STOP
if [ -z "$SUBIT" ]; then
$JBOSS_CMD_STOP
else
$SUBIT "$JBOSS_CMD_STOP"
fi
rm -rf $JBOSS_HOME/server/$JBOSS_CONF/tmp/*
rm -rf $JBOSS_HOME/server/$JBOSS_CONF/work/*
;;
restart)
$0 stop
i=0
while [ `ps ax|grep -v grep|grep java|wc -l` -gt 0 -a $i -lt 60 ]
do
sleep 1
(( i += 1 ))
done
/usr/bin/killall -9 java
$0 start
;;
*)
echo "usage: $0 (start|stop|restart|help)"
esac
7-# chmod 755 jboss atau chmod +x /etc/init.d/jboss
8-#chkconfig --add jboss
9-# chkconfig --level 234 jboss on
10-
11- #1. Salin fail database connector .jar kepada /opt/jboss/jboss-as/server/production/lib/
Contoh, untuk MSSQL, jtds-1.x.x.jar
untuk Oracle, ojdbc6.jar
untuk MySQL, mysql-connector-java-5.x.x-bin.jar (Download & extrak)
untuk Oracle, ojdbc6.jar
untuk MySQL, mysql-connector-java-5.x.x-bin.jar (Download & extrak)
12-1. cd jboss-as/server/production/conf
vim jboss-log4j.xml #edit dengan tambah line ini" .${jboss.bind.address}."<param name="File"value="${jboss.server.log.dir}/server.${jboss.bind.address}.log"/>
<param name="File" value="${jboss.server.log.dir}/cluster.${jboss.bind.address}.log"/>
13-1. vim /opt/jboss/jboss-as/server/production/conf/props/jmx-console-users.properties
admin=admin #Tukar katalaluan admin, musti sama dengan /etc/init.d/jboss
14 1. cd /jboss-as/server/production/deploy
Arahan berikut adalah berdasarkan kepada MYSQL, gunakan fail betul untuk pangkalan data yang lain
· rm hsqldb-ds.xml
· rm messaging/hsqldb-persistence-service.xml
· cp /opt/jboss/jboss-as/docs/examples/jca/mysql-ds.xml /data/deploy/
· ln -s /data/deploy/mysql-ds.xml
· vim mysql-ds.xml
o set DefaultDS pada pemgkalan data yang berbeza pada MYSQL, atau jboss db
o Semua servers dalam cluster yang sama mesti guna pengkalan data sama
· cp /jboss/jboss-as/docs/examples/jms/mysql-persistence-service.xml messaging/
· vim messaging/ mysql-persistence-service.xml
o <attribute name="Clustered">true</attribute> #edit dengan mengubah kepada "true"
· vim messaging/messaging-jboss-beans.xml
o <property name="suckerPassword">Password</property>
· Jalankan arahan untuk dapatkan password hash
o java -cp /opt/jboss/client/jboss-messaging-client.jar org.jboss.messaging.util.SecurityUtil Password
· vim messaging/messaging-service.xml
<attribute name="SuckerPassword">Hasil katalaluan yang telah terenkripsi(Walaupun ada “-”Contohnya -54ytyde33 )</attribute>
15- 1. Vim jbossweb.sar/server.xml
Komen atau keluarkan baris ini
<!--<Connector port="8009" address="${jboss.bind.address}" protocol="AJP/1.3"
emptySessionPath="true" enableLookups="false" redirectPort="8443" />-->
<!--<Engine name="jboss.web" defaultHost="localhost" >-->
Tambah baris ini.
<Connector port="8009" address="${jboss.bind.address}"
emptySessionPath="true" enableLookups="false" redirectPort="8443"
protocol="AJP/1.3" connectionTimeout="600000" maxThreads="500"
useBodyEncodingForURI="true" URIEncoding="UTF-8" />
<Connector port="8009" address="127.0.0.1"
emptySessionPath="true" enableLookups="false" redirectPort="8443"
protocol="AJP/1.3" connectionTimeout="600000" maxThreads="500"
useBodyEncodingForURI="true" URIEncoding="UTF-8" />
<Engine name="jboss.web" defaultHost="localhost" jvmRoute="node${jboss.messaging.ServerPeerID}">
<Valve className="org.jboss.web.tomcat.service.sso.ClusteredSingleSignOn" />
16#chown -Rf jboss:jboss /opt/jboss
16# service jboss start
16# service jboss start
JBOSS_CMD_START = cd /opt/jboss/jboss-as/bin; /bin/sh /opt/jboss/jboss-as/bin/run.sh -c production -b 10.0.2.40 -g cluster1 -Djboss.messaging.ServerPeerID=40 -DjvmRoute=node40
17#service jboss stop
JBOSS_CMD_STOP = java -classpath /opt/jboss/jboss-as/bin/shutdown.jar:/opt/jboss/jboss-as/client/jnet.jar org.jboss.Shutdown --shutdown -s 10.0x.x -u admin -p password
Shutdown message has been posted to the server.
Server shutdown may take a while - check logfiles for completion
Shutdown message has been posted to the server.
Server shutdown may take a while - check logfiles for completion
18-Test buka IP http://yourdomain.com:8080 or http://yourip:8080
19- Untuk Setting mod_jk, jsvc, https boleh rujuk :-
http://catatan-khairi.blogspot.com/2013/11/install-tomcat-7-pada-redhat-64.html
20;- Boleh jimatkan ruang untuk fail sistem dengan pindah fail aplikasi Jboss ke nfs yang telah di mount ke /data (contohnya).
#mv /opt/jboss /data/.
#cd /data/sys/pos1/jboss/jboss-as/
#mv tmp work /opt/jboss/.
#cd /opt/jboss/
# ln -s work tmp /data/sys/pos1/jboss/jboss-as/.
yum -y install vim htop iptraf yum-security yum-presto
- htop is a nice console process viewer
- iptraf is a console traffic monitor
- yum-security searches for security patches and can install them automatically
- yum-presto speeds up your downloads from your yum repository
Rujukan
http://davidghedini.blogspot.com/2011/03/install-jboss-51-on-centos.html
http://refcardz.dzone.com/refcardz/getting-started-jboss
http://training-course-material.com/training/JBoss_5.1_-_Chapter_01_-_Installing_Core_Components
http://blog.c2b2.co.uk/2013/01/setting-up-jboss-eap-5-cluster-with.html