JBoss 下的目录结构说明和端口修改相关

来源:互联网 发布:nba2konline韩德君数据 编辑:程序博客网 时间:2024/05/16 16:01

Tomcat  作为J2EE服务器之一,其支持的只有JSP / Servlet 容器;

JBoss 作为J2EE服务器之一,其功能比Tomcat 还大,除了 Tomcat 支持的功能外,还支持 EJB ,最近接触到这个软件,那么下面就了解一下 JBoss 下的目录结构,收集查找来自网上;


1,JBoss 的安装目录下的文件夹有: bin,client,docs,lib,server 五个文件夹,同时还有一些文本型的 .txt, .html, .xml 文件 ;下面就分别一下各个文件夹;


1.1 bin

Contains startup, shutdown and other system-specific scripts. Basically all the entry point JARs and start scripts included with the JBoss distribution are located in the bin directory. 

包含了服务器启动,关闭和系统相关的脚本。基本上所有jar文件的进入点和启动脚本都在这个目录里面。 


1.2, client

Stores configuration files and JAR files that may be used by a Java client application (running outside JBoss) or an external web container. You can select archives as required or use jbossall-client.jar. 

保存 Java 客户端应用或外部web容器(在JBoss之外运行),所需的配置文件和 Jar 文件。


1.3, docs

Contains the XML DTDs used in JBoss for reference (these are also a useful source of documentation on JBoss configuration specifics). There are also example JCA (Java Connector Architecture) configuration files for setting up datasources for different databases (such as MySQL, Oracle, Postgres). 

包含一些jboss的XML DTD文件,还有一些案例和文档。


1.4,lib 

Contains startup JARs used by JBoss. Do not place your own JAR files in this directory. 

包含JBoss所需的 jar 文件。不要把你自己的 jar 文件放在这个目录。 


1.5,server

Contains the JBoss server configuration sets. Each of the subdirectories in here is a different server configuration. JBoss ships with minimal, default, production, and all configuration sets. The subdirectories and key configuration files contained in the default configuration set are discussed in more detail in subsequent sections. 

包含JBoss服务器实例的配置集合。这里的每个子目录就是一个不同的服务器实例配置。

注意:  每个不同的服务器实例配置, 即提供不同服务功能项的jboss启动模式,说明: 
all 文件夹对应的是启动所有jboss服务的实例配置; 
default 文件夹对应的是默认的jboss服务的实例配置; 
minimal 文件夹对应的是启动jboss的最小/少的服务配置;


2,JBOSS_Home/server/<instance-name> [JBOSS 安装目录下的server文件下的某个服务器实例配置(all,default,minimal之一)下的文件夹结构],这里选择default来说明[其余两个估计有别],

2.1, conf 
The conf directory contains the jboss-service.xmlbootstrap descriptor file for a given server configuration. This defines the core services that are fixed for the lifetime of the server. 

conf 目录中包含了这个服务器的启动描述文件 jboss-service.xml。这个文件定义了服务器运行时间内提供那些固定的核心服务。


2.2, data 
The datadirectory is available for use by services that want to store content in the file system. It holds persistent data for services intended to survive a server restart. Serveral JBoss services, such as the embedded Hypersonic database instance, store data here. 

服务中需要存储内容到文件系统的都会保存到 data 目录。JBoss内嵌的Hypersonic database的数据也是保存到这里的。 


2.3, deploy 
The deploydirectory contains the hot-deployable services (those which can be added to or removed from the running server). It also contains applications for the current server configuration. You deploy your application code by placing application packages (JAR, WAR and EAR files) in the deploydirectory. The directory is constantly scanned for updates, and any modified components will be re-deployed automatically. This may be overridden through the URLDeploymentScanner URLs attribute. 

deploy中包含可热部署的服务(可以在服务器运行时动态添加和删除)。当然这里还包含有这个服务器实例下的应用程序。你可以发布你的应用程序代码的
压缩包(JAR,WAR和EAR文件)到这里。这里目录会被搜索更新,所有修改的组件都会被自动重新部署。 


2.4, lib 
This directory contains JAR files (Java libraries that should not be hot deployed) needed by this server configuration. You can add required library files here for JDBC drivers etc. All JARs in this directory are loaded into the shared classpath at startup. 

这个目录中包含这个服务器配置需要的JAR文件(这些java库不需要被热部署)。你可以添加需要的库文件到这里,如JDBC驱动等。
所有的 jar 文件将在服务器启动的时候被加载到共享的 classpath 中。


2.5, log 
This is where the log files are written. JBoss uses the Jakarta log4jpackage for logging and you can also use it directly in your own applications from within the server. This may be overridden through the conf/log4j.xml configuration file. 

日志文件会被写到这里。如果你要修改日志输出目录,可以通过配置 conf/log4j.xml 实现。
 

2.6, tmp 
The tmpdirectory is used for temporary storage by JBoss services. The deployer, for example, expands application archives in this directory. 

tmp 目录被用来提供 JBoss 服务的临时存储。


2.7, work 
This directory is used by Tomcat for compilation of JSPs. 

提供给 tomcat 编译 jsp 文件用 



3,JBoss 的访问端口修改

默认访问地址:  http://localhost:8080/   端口为8080,如果修改端口,可在 jboss_Home\server\[default | all | minimal 实例之一]\deploy\jboss-web.deployer下面的server.xml 文件中修改, Connector元素的 port="端口号", 默认端口为8080.