Linux Server JBoss running environment setup steps and Automatic startup script compilation and running

Source: Internet
Author: User

Linux Server JBoss running environment setup steps and Automatic startup script compilation and running

Jboss running environment: Linux + Jdk + Jboss + jsp system

Jboss Software Description: similar to Tomcat, it is an environment for running Jsp systems. Its site path is similar to Tomcat. Tomcat stores site files under the webapps directory, jboss is stored in the server/default/deploy directory.

The development environment and test steps are as follows:

Linu Operating System: CentOS 64-bit

JBoss Software
Http://sourceforge.net/projects/jboss/files/JBoss/JBoss-4.2.3.GA
Http://sourceforge.net/projects/jboss/files/JBoss/JBoss-4.2.3.GA/jboss-4.2.3.GA.zip/download
Http://sourceforge.net/projects/jboss/files/JBoss/JBoss-4.2.3.GA/jboss-4.2.3.GA-jdk6.zip/download

Software name after download
Jboss-4.2.3.GA.zip
Jboss-4.2.3.GA-jdk6.zip

Decompress the file
Unzip/soft/jboss-4.2.3.GA.zip

Java installation: I have installed other advanced versions, so I will not install JDK6 any more. After the configuration is complete, I can run Jboss.


Create directory
Cd/
Mkdir data
Cd data

Mkdir app
Cd app

Unzip/soft/jboss-4.2.3.GA.zip

Cd/data/app/

Chmod + x/data/apps/jboss-4.2.3.GA


Set the environment variable JBOSS_HOME

Run the vim/etc/profile command and add the environment variable Code as follows:

# Jdk config
Export JAVA_HOME =/usr/java/jdk1.7.0 _ 67
Export CALSSPATH = $ JAVA_HOME/lib /*.*

# Jboss config
Export JBOSS_HOME =/data/app/jboss-4.2.3.GA

# Path config
Export PATH = $ PATH: $ JAVA_HOME/bin: $ JBOSS_HOME/bin

Execute Command source/etc/profile to refresh environment variable

 

Jboss script automatically started after startup


Run the command vi/etc/rc. d/init. d/jboss to generate the script file. The content is as follows:

#! /Bin/bash

#

#/Etc/rc. d/init. d/jboss

# Init script for jboss precesses

#

# Processname: jboss

# Description: jboss is a j2se server

# Chkconfig: 2345 86 16

# Description: Start up the Jboss servlet engine.

If [-f/etc/init. d/functions]; then

./Etc/init. d/functions

Elif [-f/etc/rc. d/init. d/functions]; then

./Etc/rc. d/init. d/functions

Else

Echo-e "\ a jboss: unable to locate functions lib. Cannot continue ."

Exit-1

Fi

RETVAL =$?

JBOSS_HOME = "/data/app/jboss-4.2.3.GA" # jboss installation directory

Case "$1" in

Start)

If [-f $ JBOSS_HOME/bin/run. sh];

Then

Echo $ "Starting Jboss"

$ JBOSS_HOME/bin/run. sh

Fi

;;

Stop)

If [-f $ JBOSS_HOME/bin/shutdown. sh];

Then

Echo $ "Stopping Jboss"

$ JBOSS_HOME/bin/shutdown. sh

Fi

;;

*)

Echo $ "Usage: $0 {start | stop }"

Exit 1

;;

Esac

Exit $ RETVAL


Automatic Start script authorization

Run the chmod 755/etc/rc. d/init. d/jboss command to make the script file executable.

Register jboss Service

Run the chkconfig -- add/etc/rc. d/init. d/jboss command to add it to the service.


Start Jboss

Run sh/data/app/jboss-4.2.3.GA/bin/run. sh command


Stop Jboss service: service jboss stop

Start Jboss service: service jboss start

Test and verification: Open http: // localhost: 8080 in Firefox and the Jboss welcome management interface is displayed.

This article permanently updates the link address:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.