我正在尝试绑定一个别名来运行我的应用程序,而不是服务器上的ip地址。因此,我希望在helloworld.business name.com:8555/helloworld上访问我的应用程序,而不是172.19.20.xxx:8555/helloworld。我在WEB-INF下的项目中添加了一个jboss-web.xml
<jboss-web>
<virtual-host>helloworld.businessname.com</virtual-host>
</jboss-web>我在我的standalone.xml中编辑了虚拟主机标签
<subsystem xmlns="urn:jboss:domain:web:1.1" native="false" default-virtual-server="default-host">
<connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
<connector name="https" protocol="HTTP/1.1" scheme="https" socket- binding="https" enable-lookups="false" secure="true">
</connector>
<virtual-server name="default-host" enable-welcome-root="true">
<alias name="localhost"/>
<alias name="example.com"/>
</virtual-server>
<virtual-server name="helloworld.businessname.com" default-web-module="helloworld">
<alias name="helloworld.businessname.com"/>
</virtual-server>当我转到helloworld.business name.com:8555/时,它显示未找到。
我很感激。
发布于 2012-04-23 20:06:57
standalone.xml没问题
将jboss-web.xml设置为:
<jboss-web>
<context-root>/</context-root>
<virtual-host>helloworld.businessname.com</virtual-host>
</jboss-web>将服务器上的主机文件(c:\windows\system32\drivers\etc\hosts或/etc/ hosts )设置为:
127.0.0.1 helloworld.businessname.com以以下身份运行服务器:
standalone.bat -b 0.0.0.0然后部署。
https://stackoverflow.com/questions/9981510
复制相似问题