First, software preparation
Jboss-5.1.0.ga.zip
Centos 6.4 64-bit
Java 1.7.0_25
Second, software deployment
1) Add Environment variables
Vim/etc/profile
Export Jboss_home=/software/jboss-5.1.0.gaexport Java_home=/software/jdk1.7.0_25export JRE_HOME=${JAVA_HOME}/ Jreexport classpath=.: $JAVA _home/lib/jt.jar: $JAVA _home/lib/tools.jar: $JRE _home/libexport path= $JAVA _home/bin:$ Jre_home/bin: $JBOSS _home/bin: $PATH
2) Configure JBoss
Note: $JBOSS the directory structure under _home/server, start the specified one to start, the default is to start
In this example, use the web directory to deploy the project, change the JBoss boot port
CD $JBOSS _home/server/web/deploy && vim jbossweb.sar/server.xml12 <connector protocol= "http/1.1" port= " 8080 "address=" 0.0.0.0 "#更改访问地址 connectiontimeout=" 20000 "redirectport=" 8443 "uriencoding=" UTF-8 "/> #添加UTF -8 encoding
Change the JBoss Deployment directory
#cd $JBOSS _home/server/default/conf/bootstrap && vim profile.xml<property name= "Applicationuris" > <list elementclass= "Java.net.URI" > <value>${jboss.server.home.url}deploy</value> #添加如下内容即添加了一个部署目录 <value>file:/home/jboss/test</value> Note: The absolute path is before the file: Start </list> </property>
Put the war pack into the $jboss_home/server/web/deploy/start service
A separate script is attached:
#!/bin/bash#this for linux jbossjboss_pid=${jboss_pid:-"' Ps aux | grep java | grep "web" | awk ' {print $2} ' "}jboss_home=${jboss_home:-"/ Software/jboss-5.1.0.ga "}javapth=${javapth:-"/software/jdk1.7.0_25/bin "} #JBOSS config " All " " Default minimal standard Web jboss_conf=${jboss_conf:-"Web"}jboss_user=${jboss_user:-" JBoss "}start () {echo " Start jboss "$JBOSS _home/bin/run.sh -c $JBOSS _conf 2 >&1 > /home/jboss/jboss_start.log &if [[ $? -eq 0 ]]; thenecho "jboss start success" elseecho "Jboss start fail" fi}stop () {echo "Stop jboss" kill -9 $JBOSS _pidif [[ $? -eq 0 ]]; thenecho "jboss stop success" elseecho "Jboss stop fail" fi}case $1 Instart) start;;; stop) stop;;; Restart) stop;sleep 10start;;; *) echo "usage:$0 (start|stop|restart)" Exit 1esac
The basic jboss-5.1.0 GA configuration is complete.
Jboss 5.1.0 GA Configuration