JBoss maintenance experience

xiaoxiao2021-04-05  238

original:

Http://www.ufgov.com.cn/support/viewdetail.asp?id=677

(UF Government Technical Support) (LZY))

First, set the console login window


Type in the address bar of the browser window after installing JBoss and launching JBOSS

Http: // localhost: 8080 / jmx-consolehttp: // localhost: 8080 / jmx-console You can browse some information about JBoss deployment management, you can enter this page by default, you can enter this page, convenient is convenient But truly use is still a safe hidden danger, because anyone just knows that Server IP can go in. Below we are configured for this issue, making access JMX-Console must also know that the username and password can be accessed.

step:

1. Enter JMX-Console.war, usually this directory in the {jboss_home} / server / default / deploy directory.

2. Edit the web-inf / web.xml in this directory, and comment out the

3. Edit the Roles.properties and Users.properties of the web-inf / classes under this directory;

1) Use the username and password in the users.properties file, format UserName = Password. Of course, multiple users can be added according to this format.

2) The username and role define the username and role in the Roles.Properties file, format UserName = Role. The Role here must correspond to in the web.xml file.

4. Edit the Web-INF / JBOSS-Web.xml file, open the part of the comment; here content corresponding to the security-domain corresponding {jboss_home} / server / default / conf / login-config. An Application-Policy in the XML this JAAS configuration file.

Such as:

Java: / jaaas / jmx-console

There is also: Login-config.xml

FLAG = "Required" />

5. OK! Everything is big! Restart JBoss, you will have the input username and Password window.

Second, start and close the JBoss application server:

1. Start JBoss Application Server:

l Double-click the desktop shortcut.

l Open the command line window, enter% jboss_home% / bin, type Run, Enter.

2. Close JBoss Application Server:

l Turn off the JBoss application server directly; 1 Open a command line window, enter% jboss_home% / bin, type shutdown? username = username -Password = password, Enter.

Third, modify the database and port connected to the JBOSS application server:

1. In JBoss? JBoss-3.x --- Server --- Default --- Deploy, in the MSSQL-Service.xml file:

JDBC: Microsoft: SQLServer: // localhost: 1433; DatabaseName = Northwind

sa

1

among them:

1JDBC: Microsoft: SQLServer: // localhost: 1433: SQL2000 port is 1433, if the database and web server is distributed to different machines, then localhost is changed to the IP address of the database server;

2DATABASENAME = Northwind: The database is Northwind, which can be modified to another database;

3 sa

User name SA using the database

4 1

Password corresponding to user name SA: 1

Note: When our database, username or password is modified, you can modify the corresponding item at MSSQL-Service.xml.

2. When using the JBoss middleware, the default access port is 8080. How to modify it?

Open JBoss Directory -> JBoss-3.0.8 -> Server -> Default -> Deploy -> JBossWeb.sar -> Meta-INF JBoss-Service.xml file, search 8080, change 8080 Restart the application server for the new port number, save the file, and use the new port number when access is accessed.

10

100

30000

5000

Fourth, other settings

1. WAR file deployment

JBoss supports thermal deployment, that is, the WAR file is deployed to the server and does not need to restart JBoss (Tomcat does not support this feature). The deployment of the WAR file is very simple, copy the WAR file directly to the JBoss / Server / Default / Deploy directory.

2. JBoss directory structure

BIN: The referendat contains various script files and related files, and two batch files have been used in front of run.bat and shutdown.bat.

Client: Store configuration information and JAR files that may be used by Java client applications or external Web containers.

DOCS: The XML file and DTD file stored in JBoss (here also provide examples of how to write configuration files in jboss). In this directory, there is a JCA configuration file that configures the data source for a database such as MySQL, Oracle, SQL Server, Postgres, etc.).

LIB: This is stored here to run the JAR file required to run the JBoss microennote. Do not store any of your own JAR files in this directory.

Server: Every subdirectory here corresponds to a server configuration. This configuration is determined by the parameter "-c " when running the script file. There are three configuration examples in the Server directory, namely all, default, and minimal, each configuration installed service is different. Where default is the default configuration.

Minimal: Only the least service required to start JBoss, such as log service, JNDI, and URL deployment scanner (discovers new deployment), does not include web containers, EJBs, and JMS.

All: Start all services, including RMI / IIOP, cluster services, and Web service deployers (the default configuration will not be loaded).

When starting JBOSS, if run.bat does not bring any parameters, the configuration used is the configuration in the Server / Default directory. If you want to start JBOSS in other directories, you can use the following parameters:

Run -c all

The above command will start JBoss in the configuration information in the all directory. You can also create a new directory in the Server directory, write the configuration files yourself.

The following is an example of a DEFAULT directory, which describes the directory structure of the server configuration.

Conf: This directory has a JBoss-Service.xml file that specifies the core service, or you can put files configured by other service.

DATA: This directory is where JBoss built-in database Hypersonic stores, and is also where JBossMQ (The JBoss IMplementation Of JMS) stores related information.

Deploy: This is where the J2EE application (JAR, WAR and EAR files) is deployed, just copy the corresponding file to this directory. This directory is also used to heat deployment services and JCA resource adapters. Some services have been deployed to this directory, such as JMX-Console, you can get JBOSS will be accessed. JBoss will scan the deploy directory periodically when there is any component changes, and JBOSS will redeploy the program.

LIB: Store the server configuration required by the server, for example, you can put the JDBC driver in this directory.

Log: Store log information. JBOSS uses Jakarta log4j package storage logs, you can also use this information directly in the program. TMP: The temporary file generated when the deployment process is decompressed.

Work: Tomcat compiles the working directory when the JSP file is compiled.

Directory DATA, LOG, TMP and WORK do not exist after JBoss installation, automatically established when JBoss is running.

In addition, the JDBC driver used to connect the database is copied to the JBoss_Home / Server / Default / Lib directory.

3. Deployment in jboss

The deployment process in JBoss is very simple, directly and supported hot deployment. In each configuration, JBoss constantly scans changes in a special directory: $ jboss_home / server / config-name / deploy.

You can copy the following files to this directory:

* Any JAR library (where the class will be automatically added to the ClassPath of JBoss)

* EJB JAR

* WAR (Web Appliction Arrchive) Note that the context is the WAR name by default.

* EAR (Enterprise Application Archive)

* Contains XML files defined by JBoss MBean

* A directory that contains EJB JAR, WAR or EAR, and ends with .jar, .war or. Peer.

Attachment: If you want to define your own server directory configuration, please refer to the following steps:

According to JBoss documents, we know that it is possible to configure a server only need to copy all the files in a new directory to a new directory and rename it, and modify the parameters in some files. Do as follows:

1. Re-designate a run.bat shortcut Runjwfm.bat

Copy the run.bat under the / bin directory, and modify

"% Java%"% java_opts% -classpath "% jboss_classpath%" org.jboss.main% * is

"% Java%"% java_opts% -classpath "% jboss_classpath%" org.jboss.main? C jwfm% *

2. Modify the corresponding parameter file

/ server / jwfm / conf directory file jboss-service.xml modified dynamic deployment time:

5000 Adjust 5000 to 800, returning 5000 after stability

转载请注明原文地址:https://www.9cbs.com/read-132106.html

New Post(0)