您查看的文章来源于http://www.oklinux.cn
三、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"