JBoss 5.0 Installation and configuration detailed

Source: Internet
Author: User
Tags auth jboss log4j

This article quoted from: Http://blog.csdn.net/allenzue/archive/2008/12/18/3549959.aspx

Another: Http://wiki.ubuntu.org.cn/JBoss_5.0.0GA Installation Guide

A Download and install JBoss

In this article, I downloaded the JBoss version as: JBOSS5.0 Beta4.

Download Address: http://www.jboss.org/jbossas/downloads/

Download the JBOSS5.0 beta4.zip file on the download page as above.

After the download is complete, unzip it to complete the installation, decompression and put it into a directory without spaces (if the directory with spaces, for example: C: "Program Files, may produce some inexplicable errors in the future), Eg:e:" JBossJBOSS5.0 Beta4. Also set the environment variable named Jboss_home in environment variable settings, the value is the installation path for JBoss, as shown in the following illustration:

At this point, the installation of JBoss has ended, and you can test the success of your installation by:

Run the JBoss installation directory "Bin" Run.bat, if no exception appears in the window, and appears: 10:16:19,765 INFO [Server] JBoss (MX microkernel) [5.0.beta4 (build:svntag= 5.0.BETA4 date=20080831605)] started in 30s:828ms indicates successful installation.

We can access the JBoss Welcome interface by visiting: http://localhost:8080/, click on the JMX console under JBoss Management to enter JBoss's console.

Failure to start can be caused by the following reasons:

1 The port used by JBoss (8080,1099,1098,8083, etc.) is occupied. Typically 8080 ports are occupied (for example, Oracle occupies 8080 ports) and the JBoss port needs to be modified by entering the JBoss installation directory "server" default "Deployer" Jboss-web.deployer Directory , modify the Server.xml directory below, search for 8080 in this file, and change it to the port you want (for example, 8088);

2 The JDK installation is not correct;

3) JBoss download is not complete.

Two Description of JBoss directory structure

Directory

Describe

Bin

Start and close JBoss scripts (Run.bat for startup scripts under Windows systems, Shutdown.bat for shutdown scripts under Windows systems).

Client

The Java Library (JARs) required by the client to communicate with JBoss.

Docs

The configured sample files (database configuration, etc.).

Docs/dtd

A DTD for various XML files used in JBoss.

Lib

Some jars, which are loaded when JBoss starts and are shared by all jboss configurations. (Don't put your library here)

Server

Various JBoss configurations. Each configuration must be placed in a different subdirectory. The name of the subdirectory indicates the name of the configuration. JBoss contains 3 default configurations: Minimial, default, and all, which you can choose to install.

Server/all

JBoss is fully configured to start all services, including clustering and IIOP.

Server/default

The default configuration for JBoss. Used when the configuration name is not specified in the JBoss command line. (The JBOSS5.0 Beta4 version we downloaded defaults to this configuration).

Server/default/conf

JBoss's configuration file.

Server/default/data

JBoss's database file. For example, an embedded database, or JBOSSMQ

Server/default/deploy

The thermal deployment directory for JBoss. Any files or directories placed here will be automatically deployed by JBoss. EJB, WAR, EAR, and even service.

Server/default/lib

Some jars, JBoss loads them when a specific configuration is started. (The default and Minimial configurations also contain this and the following two directories.) )

Server/default/log

JBoss's log file.

Server/default/tmp

The temporary file for JBoss.

Three The configuration of JBoss

1. log File Settings

If you need to modify the JBoss default log4j setting, modify the Jboss-log4j.xml file under the JBoss installation directory "Server" default conf, where you can see log4j log output in the JBoss installation directory "Server" In the Server.log file under the "Default" log. For log4j settings, readers can search for more detailed information on the web.

2. Modification of the port number of the Web service

This is mentioned in the previous article, that is, modify the Server.xml file under the JBoss installation directory "server" default "Deployer" Jboss-web.deployer, as follows:

<connector port= "8080" address= "${jboss.bind.address}"

maxthreads= "maxhttpheadersize=" "8192"

Emptysessionpath= "true" protocol= "http/1.1"

Enablelookups= "false" redirectport= "8443" acceptcount= "100"

connectiontimeout= "20000" disableuploadtimeout= "true"/>

Change the top 8080 port to the port you want. After restarting JBoss access: http://localhost/: The newly set port can see the JBoss welcome interface.

3. JBoss security Settings

1) jmx-console login username and password settings

By default access Http://localhost:8080/jmx-console can browse JBoss deployment management of some information, do not need to enter a username and password, use a bit of security risks. Below we configure JBoss for this issue so that access Jmx-console must also know the username and password to access it. The steps are as follows:

i) find the JBoss installation directory/server/default/deploy/jmx-console.war/web-inf/jboss-web.xml file, remove <security-domain>java:/ Jaas/jmx-console</security-domain> 's comment. The contents of the modified file are: <jboss-web>

<!--uncomment the Security-domain to enable security. You'll

Need to edit the htmladaptor login configuration to setup the

Login modules used to authentication users.-->

<security-domain>java:/jaas/jmx-console</security-domain>

</jboss-web>

(ii) Modify the Web.xml file in the Jboss-web.xml sibling directory in the i), find the <security-constraint/> node, remove its annotations, and modify the contents as follows:
<!--A security constraint which restricts access to the HTML JMX console

To the users and the role jbossadmin. Edit the roles to what you want and

Uncomment the Web-inf/jboss-web.xml/security-domain element to enable

Secured access to the HTML JMX console.-->

<security-constraint>

<web-resource-collection>

<web-resource-name>HtmlAdaptor</web-resource-name>

<description> A example security config This is allows users with the

Role jbossadmin to access the HTML JMX console Web application

</description>

<url-pattern>/*</url-pattern>



</web-resource-collection>

<auth-constraint>

<role-name>JBossAdmin</role-name>

</auth-constraint>

</security-constraint>

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.