Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install and configure JBOSS under LINUX

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to install and configure JBOSS under LINUX, which has a certain reference value, and interested friends can refer to it. I hope you can learn a lot after reading this article.

Environment: Linux AS5 Update3

JBOSS: http://www.jboss.org/jbossas/downloads/

Download jboss-5.1.0.GA.tar.gz (or other versions, this article uses jboss-5.1.0.GA as an example)

JDK: http://java.sun.com/javase/downloads/index.jsp

Download: jdk-6u17-linux-i586.bin (or other versions, this article uses jdk-6u17-linux-i586 as an example)

All the software is uploaded to the server / usr/local/ directory

1. Environment configuration

A, character set configuration

Set the system locale: / etc/sysconfig/i18n to zh_CN.GBK

Vi / etc/sysconfig/i18n

LANG= "zh_CN.GBK"

SUPPORTED= "zh_CN.GBK:zh:zh_CN.GB2312:zh:zh_CN.UTF-8:zh_CN:zh:en_US.UTF-8:en_US:en"

SYSFONT= "latarcyrheb-sun16"

B. Modify the character set setting: / etc/profile add NLS_LANG setting

# vi / etc/profile

Export NLS_LANG='SIMPLIFIED CHINESE_CHINA'.ZHS16GBK

C, check whether the time zone and time of the server are set correctly: the correct time zone should be set to: China standard Time (CST) Chinese Standard time.

Execute cat / etc/sysconfig/clock to see if the following three lines are displayed, if not, you need to make the following modification steps (or perform timeconfig)

ZONE= "Asia/Shanghai"

UTC=false

ARC=false

Modify the steps:

# mv / etc/localtime / etc/localtime.bak

# ln-sf / usr/share/zoneinfo/Asia/Shanghai / etc/localtime

Change the time zone file (/ etc/sysconfig/clock) to the following:

ZONE=Asia/Shanghai

UTC=false

ARC=false

2. Install JDK

Change j2sdk permissions to executable

# chmod 755 jdk-6u17-linux-i586.bin

#. / jdk-6u17-linux-i586.bin

Follow the prompts to install and select yes to perform the installation

After installation, a java folder is generated in the / usr/ directory

# vi / etc/profile

Add the following lines:

JAVA_HOME=/usr/java/jdk1.6.0_04 / / the directory where jdk is configured

CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/jre/lib/rt.jar

NLS_LANG='SIMPLIFIED CHINESE_CHINA'.ZHS16GBK

PATH=$JAVA_HOME/bin:$PATH:$HOME/bin:$JAVA_HOME/jre/bin

Note:

$JAVA_HOME/bin: put it first because this is the path to the jdk we installed, and programs developed generally execute JDK under this path. If you don't put it first, the execution may be the JDK that comes with the system, and sometimes an error will be reported because of a path error.

Modify the export line by adding:

Export JAVA_HOME CLASSPATH PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC NLS_LANG

Log out of the environment for the environment variable to take effect (or execute the source / etc/profile command)

Check whether JDK is installed successfully

# echo $JAVA_HOME (the directory where JDK is displayed)

# java-version (view JDK version information)

If the JDK version information is displayed correctly, the java environment variable is configured successfully.

3. Install jboss

# tar-zxvf jboss-5.1.0.GA.tar.gz

Modify jboss startup port

# vi / usr/local/jboss-5.1.0.GA/server/default/deploy/jbossweb-tomcat55.sar/server.xml

Where the original file is modified (the original file is about 13 lines)

Modified file

Prevent unlimited expansion of LOG files

Open the log4j.xml text in the / usr/local/jboss-5.1.0.GA/server/default/conf/ directory

# vi / usr/local/jboss-5.1.0.GA/server/default/conf/log4j.xml

Under the following statement block (about 25 lines):

Add the following statement:

Allocation of Jboss memory

# vi / usr/local/jboss-5.1.0.GA/bin/run.conf (around line 42)

Change if ["x$JAVA_OPTS" = "x"]; then

JAVA_OPTS= "- server-Xss128k"

Fi

Modify to

If ["x$JAVA_OPTS" = "x"]; then

JAVA_OPTS= "- server-Xms1g-Xmx2g-Xss256k" / / Note-medium bar in English

Fi

The maximum value of files and the number of backups can be changed according to the actual situation.

Jboss startup and shutdown

Start jboss:

Background running commands for nohup / usr/local/jboss-5.1.0.GA/bin/run.sh &\\ jboss

View startup information:

Tail-f nohup.out

Turn off jboss:

/ usr/local/jboss-5.1.0.GA/bin/shutdown.sh-S

= =

Nohup. / run.sh &

Note the path of run.sh

Enter in shell will prompt:

[~] $appending output to nohup.out

The standard output of the original program is automatically redirected to the nohup.out file in the current directory, which plays the role of log.

Stop logging for jboss (back up the source file first) and perform this step as appropriate

# mkdir-p / backup/jboss

# cp / usr/local/jboss-5.1.0.GA/server/default/conf/log4j.xml log4j (backup month) .xml

# cd / usr/local/jboss-5.1.0.GA/server/default/conf

# vi log4j.xml

From

To

Just comment it all out.

Modify the record level of jboss (backup / usr/local/jboss-5.1.0.GA/bin/run.jar)

# cp / usr/local/jboss-5.1.0.GA/bin/run.jar / backup/jboss/run (backup month). Jar

# cd / usr/local/jboss-5.1.0.GA/bin

# unzip run.jar-d run

# cd run

Modify the log4j.properties file in the directory

# vi log4j.properties

Log4j.rootCategory=DEBUG, FILE, CONSOLE

Change to log4j.rootCategory=WARN, FILE, CONSOLE

Repackage

# jar-cvf run.jar *

# chmod 755 run.jar

# mv run.jar / usr/local/jboss-5.1.0.GA/bin/

Just cover it.

Start jboss

# nohup. / run.sh &

4. Test jboss

Enter http://ip:port, in the browser to see if the jboss page appears. If the jboss page appears, the jboss installation is successful.

5. Deploy applications

Move the packed j2ee project * .war to $JBOSS_HOME/server/default/deploy/

# mv * *. War $JBOSS_HOME/server/default/deploy

Open the service and run the project

Http://ip:port/****/****.jsp / / port depends on the actual situation

Thank you for reading this article carefully. I hope the article "how to install and configure JBOSS under LINUX" shared by the editor will be helpful to everyone. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report