关于JBOSS的HOST配置问题

WEB-INF/jboss-web.xml

In your web application you’ll want to add an xml file named “jboss-web.xml” to your WEB-INF folder. This is the file that’s going to map both the web application’s context and host in jboss.

<jboss-web>
<context-root>/</context-root>
<virtual-host>www.first-application.com</virtual-host>
</jboss-web>


jbossweb.sar/server.xml

Now we need to edit jboss’ server.xml file, adding the virtual host mappings:

[CODE="JAVA"]
<Server>
<Service name="jboss.web"
className="org.jboss.web.tomcat.tc5.StandardService">

<!-- A HTTP/1.1 Connector on port 8080 -->
<Connector port="8080" address="${jboss.bind.address}"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true"/>

<Engine name="jboss.web" defaultHost="www.first-application.com">
<Realm className="org.jboss.web.tomcat.security.JBossSecurityMgrRealm"
certificatePrincipal="org.jboss.security.auth.certs.SubjectDNMapping"
/>
<Logger className="org.jboss.web.tomcat.Log4jLogger"
verbosityLevel="WARNING"
category="org.jboss.web.localhost.Engine"/>

<Host name="www.first-application.com" autoDeploy="false"
deployOnStartup="false" deployXML="false">
<Alias>dev.first-application.com</Alias>
<Alias>qa.first-application.com</Alias>
<Alias>test.first-application.com</Alias>
<Valve className="org.apache.catalina.valves.AccessLogValve"
prefix="localhost_access_log."
suffix=".log"
pattern="common"
directory="${jboss.server.log.dir}"
resolveHosts="false" />
</Host>

<Host name="www.second-application.com" autoDeploy="false"
deployOnStartup="false" deployXML="false">
<Alias>dev.second-application.com</Alias>
<Alias>qa.second-application.com</Alias>
<Alias>test.second-application.com</Alias>

<Valve className="org.apache.catalina.valves.AccessLogValve"
prefix="localhost_access_log."
suffix=".log"
pattern="common"
directory="${jboss.server.log.dir}"
resolveHosts="false" />
</Host>

</Engine>
</Service>
</Server>
[/CODE]
上面是官方的host配置文档。我发现host name必须为www.**.com的形式,不能没有www,要不然,JBOSS识别不了。目前就发现这个问题,不知为什么。配置Tomcat时,并没有这个闻听出现。
还有,当遇到,什么ROOT.WAR已经存在的问题,可以把web.xml中的 <context-root>/</context-root> 改成你,当前部署的war名字,就行了。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值