最近有个应用要部署到JBoss上,就用了较新的JBoss4.2版本。
部署上去很奇怪的是,以前用4.0GA版本的时候,部署完毕在ie地址栏敲入ip:port就能访问的应用却报错说:找不到服务器~而用localhost:port就可以正常访问。
百思不得其解~
回来,google了一下,又到官网上看了一下release notes,找到两个解决办法,可以用IP直接访问应用:
1、直接修改jboss-4.2.0.GA\server\default\deploy\jboss-web.deployer\server.xml:
将中的${jboss.bind.address}改为实际的IP地址或者0.0.0.0即可恢复ip直接访问。
- <Connector port="8088" address="${jboss.bind.adress}"
- maxThreads="250" maxHttpHeaderSize="8192"
- emptySessionPath="true" protocol="HTTP/1.1"
- enableLookups="false" redirectPort="8443" acceptCount="100"
- connectionTimeout="20000" disableUploadTimeout="true" />
2、修改启动脚本文件run.bat,加上执行参数 -b options:
先创建一个run.bat的快捷方式,然后右键快捷方式,查看其属性,在“目标”栏中加入-b 192.168.19.34或者-b 0.0.0.0,然后启动这个快捷方式即可。

官网上有以下说明:
JBossAS 4.2.0.GA
* JBossAS now binds its services to localhost (127.0.0.1) *by default*, instead of binding to all available interfaces (0.0.0.0). This was primarily done for security reasons because of concerns of users going to production without having secured their servers properly. To enable remote access by binding JBoss services to a particular interface, simply run jboss with the -b option. To bind to all available interfaces and re-enable the legacy behaviour use -b 0.0.0.0. In any case, be aware you still need to secure you server properly.
本文介绍了解决JBoss 4.2版本应用部署后无法通过IP地址直接访问的问题。提供了两种解决方案:一是修改server.xml文件中的绑定地址;二是通过启动参数进行设置。并提醒用户注意服务器的安全配置。

被折叠的 条评论
为什么被折叠?



