ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 从外部访问JBoss4.2.X应用

从外部访问JBoss4.2.X应用

原创 Linux操作系统 作者:Angel.John 时间:2008-11-17 21:26:02 0 删除 编辑

最近搞cxf发布服务,遇到个问题:

在本地通过IP或机器名无法访问制作好的Webservice,只能是localhost。

鉴于以往的经验,检查网络、网卡等,都没问题啊。

是什么问题呢。

在网上搜到这样的解决办法;

1.启动脚本加 -b 0.0.0.0

在Jboss的启动脚本中加入 -b 0.0.0.0,外部就可以访问了。

 2.修改server.xml(JBOSS_HOME/server/default/deploy/jboss-web.deployer/server.xml)

原内容:
         maxThreads="250" maxHttpHeaderSize="8192"
         emptySessionPath="true" protocol="HTTP/1.1"
         enableLookups="false" redirectPort="8443" acceptCount="100"
         connectionTimeout="20000" disableUploadTimeout="true" />
->
改后内容:
          maxThreads="250" maxHttpHeaderSize="8192"
         emptySessionPath="true" protocol="HTTP/1.1"
         enableLookups="false" redirectPort="8443" acceptCount="100"
         connectionTimeout="20000" disableUploadTimeout="true" />
 
参考资料:
http://jlorenzen.blogspot.com/2007/10/enabling-remote-access-to-jboss-42.html

Enabling remote access to JBoss 4.2

var dzone_url = 'http://jlorenzen.blogspot.com/2007/10/enabling-remote-access-to-jboss-42.html'

Today I had an issue remotely accessing my JBoss instance running on another machine. Unknowingly, JBoss 4.2 binds specifically to 127.0.0.1 by default (see below for me details). Thankfully they had a simple solution; just append -b 0.0.0.0 to your startup script. to bind to all interfaces. So to start JBoss on linux when I know I want to access it remotely I do:

./jboss/bin/run.sh -b 0.0.0.0

ReadMe.html content on this subject:
"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 behavior. use -b 0.0.0.0. In any case, be aware you still need to secure you server properly."

 
 
 
 
 

 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10531/viewspace-496188/,如需转载,请注明出处,否则将追究法律责任。

上一篇: AOP使用小结1
请登录后发表评论 登录
全部评论

注册时间:2008-02-04

  • 博文量
    41
  • 访问量
    212637