JBOSS6入门配置
公司项目中使用了jboss,具体版本 jboss6.1.0.Final
- 设置端口
修改 jbossweb.sar/server.xml;将默认的8080端口 修改成自己需要的端口
<Connector protocol="HTTP/1.1" port="8080" address="0.0.0.0"
redirectPort="${jboss.web.https.port}" URIEncoding="UTF-8"/>
2.支持中文
在上面的配置信息中添加 URIEncoding="UTF-8"(蓝色部分),即可支持URL中出现中文
3. 设置 URL 大小不敏感 。
修改 jbossweb.sar/context.xml 文件,增加如下着色部分,即可实现对图片和其他静态资源的不区分大小写的访问,但是jsp的访问还是严格需要区分大小写。
<Context cookies="true" crossContext="true" allowLinking="true" caseSensitive="true">
4.设置默认项目
第一步:在需要设置的项目中的web-inf 下面添加文件jboss-web.xml
主要内容如下:
<jboss-web>
<context-root>/</context-root>
<virtual-host></virtual-host>
</jboss-web>
第二步: 将server\default\deploy\下的ROOT.war 改为小写的root.war
第三步:启动或重启JBOSS
JBOSS的配置信息最好还是去jboss官方网站查询
In JBoss AS 5, allowLinking="true" as <Context cookies="true" crossContext="true" allowLinking="true"> in context.xml placed at jboss-5.0.0.GA\server\default\deploy\jbossweb.sar.
caseSensitive
If the value of this flag is true, all case sensitivity checks will be disabled. If not specified, the default value of the flag is true.
NOTE: This flag MUST NOT be set to false on the Windows platform (or any other OS which does not have a case sensitive filesystem), as it will disable case sensitivity checks, allowing JSP source code disclosure, among other security problems.
allowLinking
If the value of this flag is true, symlinks will be allowed inside the web application, pointing to resources outside the web application base path. If not specified, the default value of the flag is false.
NOTE: This flag MUST NOT be set to true on the Windows platform (or any other OS which does not have a case sensitive filesystem), as it will disable case sensitivity checks, allowing JSP source code disclosure, among other security problems.
Jboss6端口修改
推荐方式:
1.进入 %JBOSS_HOME%\server\default\conf\bindingservice.beans\META-INF
2. 编辑 bindings-jboss-beans.xml
3. 搜索 “8080″ ,格式如下:
<bean class=”org.jboss.services.binding.ServiceBindingMetadata”>
<property name=”serviceName”>jboss.web:service=WebServer</property>
<property>HttpConnector</property>
<property>8080</property>
<property>JBoss Web HTTP connector socket; also drives the values for the HTTPS and AJP sockets</property>
</bean>
简易方式:
1.进入 boss-6.0.0.Final\server\default\deploy\jbossweb.sar
2. 编辑 server.xml
3. 搜索 “8080″ ,格式如下:
<Connector protocol=”HTTP/1.1″ port=”${jboss.web.http.port}” address=”${jboss.bind.address}”
redirectPort=”${jboss.web.https.port}” />
address默认为127.0.0.1,局域网不能访问,或指定-b 0.0.0.0,或在这里修改为0.0.0.0就能访问了。
最后都需要重启jboss服务器