Install JBoss AS in CentOS
a) install JDK, both 1.5 and 1.6 are suitable.# yum install java-1.6*
# vi /etc/profileJAVA_HOME=/usr/java/jdk1.6.0PATH=$JAVA_HOME/bin:$PATHCLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar# java -version java version "1.6.0_20" Java(TM) SE Runtime Environment (build 1.6.0_20-b02) Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)
b) install JBoss.
# cd /usr/java/jboss-5.1.0.GA # jar -xf jboss-5.1.0.GA.zip # vi jboss
#!/usr/bin/pythonimport os,sys,statif len(sys.argv)<2 : print 'No action specified.'print 'usage: jboss (start|stop|restart)' sys.exit()#change or add an environment variable.:JBOSS_HOME = '/usr/java/jboss-5.1.0.GA'os.putenv('JBOSS_HOME', JBOSS_HOME)STARTCMD = JBOSS_HOME +'/bin/run.sh -c default -b 0.0.0.0 &'SHUTDOWNCMD = JBOSS_HOME + '/bin/shutdown.sh -S'option = sys.argvif option == 'start' : os.system(STARTCMD)elif option == 'stop' : os.system(SHUTDOWNCMD)elif option == 'restart' :os.system(SHUTDOWNCMD)os.system(STARTCMD)else :print 'usage: jboss (start|stop|restart)' sys.exit()
By default JBoss listens only to localhost, keep this in mind, and provide the startup with the “-b 0.0.0.0″ if you want your installation be accessible from anywhere.
# chmod 755 jboss # chmod 755 /usr/java/jboss-5.1.0.GA/bin/*.sh # ./jboss start # ./jboss stop
页:
[1]