linux jboss mysql_JBOSS的安装配置 - Linux环境下JDK,JBOSS以及MySQL的安装配置_服务器应用_Linux公社-Linux系统门户网站...

三、JBOSS的安装配置

jboss版本选用jboss4.0.3,下载地址:http://www.jboss.org/jbossas/downloads/,不过本人使用的是一个已经解压缩好的文件夹

用root登录系统开始安装

1,假设jboss4.0.3文件夹位于/usr/local/suncer/server目录下运行命令

#将jboss_init_RedHat.sh复制到启动目录下并重命名为jboss

cp /usr/local/suncer/server/jboss4.0.3/bin/jboss_init_redhat.sh /etc/rc.d/init.d/jboss

2,打开/etc/rc.d/init.d/jboss文件,修改其中的配置:

JBOSS_HOME=${JBOSS_HOME:-"/usr/local/suncer/server/jboss4.0.3"}

JavaPTH=${JAVAPTH:-"/usr/java/jdk1.5.0_16/bin"}

JBOSSCP=${JBOSSCP:-"$JBOSS_HOME/bin/shutdown.sh -S"}

JBOSSSH=${JBOSSSH:-"$JBOSS_HOME/bin/run.sh"}

JBOSSUS=${JBOSSUS:-"root"}

CMD_START="$JBOSSSH"

CMD_STOP="cd $JBOSS_HOME/bin; $JBOSSCP"

修改完毕正确的文件内容如下:

#!/bin/sh

#

# JBoss Control Script

#

# chkconfig: 3 80 20

# description: JBoss EJB Container

#

# To use this script

# run it as root - it will switch to the specified user

# It loses all console output - use the log.

#

# 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.

# Bojan

#

# Either amend this script for your requirements

# or just ensure that the following variables are set correctly

# before calling the script

# [ #420297 ] JBoss startup/shutdown for RedHat

#define where jboss is - this is the directory containing directories log, bin, conf etc

JBOSS_HOME=${JBOSS_HOME:-"/usr/local/suncer/server/jboss4.0.3"}

#make java is on your path

JAVAPTH=${JAVAPTH:-"/usr/local/suncer/server/jdk1.5.0/bin"}

#define the classpath for the shutdown class

JBOSSCP=${JBOSSCP:-"$JBOSS_HOME/bin/shutdown.sh -S"}

#define the script to use to start jboss

JBOSSSH=${JBOSSSH:-"$JBOSS_HOME/bin/run.sh"}

if [ -n "$JBOSS_CONSOLE" -a ! -d "$JBOSS_CONSOLE" ]; then

# ensure the file exists

touch $JBOSS_CONSOLE

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"}

#define the user under which jboss will run, or use RUNASIS to run as the current user

JBOSSUS=${JBOSSUS:-"root"}

CMD_START="$JBOSSSH"

CMD_STOP="cd $JBOSS_HOME/bin; $JBOSSCP"

if [ "$JBOSSUS" = "RUNASIS" ]; then

SUBIT=""

else

SUBIT="su - $JBOSSUS -c "

fi

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

echo CMD_START = $CMD_START

case "$1" in

start)

cd $JBOSS_HOME/bin

if [ -z "$SUBIT" ]; then

eval $CMD_START >${JBOSS_CONSOLE} 2>&1 &

else

$SUBIT "$CMD_START >${JBOSS_CONSOLE} 2>&1 &"

fi

;;

stop)

if [ -z "$SUBIT" ]; then

$CMD_STOP

else

$SUBIT "$CMD_STOP"

fi

;;

restart)

$0 stop

$0 start

;;

*)

echo "usage: $0 (start|stop|restart|help)"

esac

—……………………

3,配置环境变量,与JDK环境变量配置方法相同,打开/etc/profile文件,在JDK环境变量处添加如下字串:

JBOSS_HOME=/usr/local/suncer/server/jboss4.0.3

修改PATH,PATH=$PATH:$JAVA_HOME/bin:$JBOSS_HOME/bin

在export后面加上 JBOSS_HOME

4,使jboss自动启动:

打开/etc/rc.d/rc.local文件,在文件后面添加如下字串,

/etc/rc.d/init.d/jboss start

5,对/etc/rc.d/init.d/jboss、/usr/local/suncer/server/jboss4.0.3/bin/run.sh以及shutdown.sh执行如下命令:

chmod +x filepath/filename使这些文件可以被执行。

6,重启服务器

JBOSS配置完毕0b1331709591d260c1c78e86d0c51c18.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值