最近有个应用要部署到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直接访问。
xml 代码
1.<Connector port="8088" address="${jboss.bind.adress}"
2. maxThreads="250" maxHttpHeaderSize="8192"
3. emptySessionPath="true" protocol="HTTP/1.1"
4. enableLookups="false" redirectPort="8443" acceptCount="100"
5. 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.
【转载地址】http://mingo.iteye.com/blog/116135
分享到:
评论