Jboss解决只能通过localhost访问而不能使用IP访问项目的问题

       之前项目都是前后端完全分离,很少使用到后端语言的开发工具,最近使用intellij+Jboss进行项目部署开发,初始用发现项目启动后只能使用localhost进行项目访问,IP地址访问则提示页面404,找了很多修改办法,最后找到一种,已经测试可以使用。

  修改jboss的配置文件,将项目访问路径配置文件中访问的IP地址修改即可。两种修改方式都可以达到IP地址访问的目的,不过也各有差别:

先找到访问路径配置文件: E:\downloadChrome\wildfly-10.1.0.Final\standalone\configuration\shandalone.xml(装的jboss是版本10.1,E盘)

默认配置是:

<interfaces>  
       <interface name="management">  
           <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>  
       </interface>  
       <interface name="public">  
           <inet-address value="${jboss.bind.address:127.0.0.1}"/>  
       </interface>  
       <interface name="unsecure">  
           <inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>  
       </interface>  
</interfaces>

方法一:

  修改为如下:

<interfaces>  
       <interface name="management">  
           <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>  
       </interface>  
       <interface name="public">  
           <inet-address value="${jboss.bind.address:0.0.0.0}"/>  
       </interface>  
       <interface name="unsecure">  
           <inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>  
       </interface>  
</interfaces>

方法二:

  修改为如下:

<interfaces>  
    <interface name="management">  
        <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>  
    </interface>  
    <interface name="public">  
        <inet-address value="${jboss.bind.address:192.168.173.85}"/>  
    </interface>  
    <interface name="unsecure">  
        <inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>  
    </interface>  
</interfaces>

 

两种修改方式的不同点在于:

  方式一修改后的访问路径为: localhost:8080/***** ; 192.168.1.***:8080/*** ; 127.0.0.1:8080/****

  方式二修改后的方位路径为:192.168.1.***:8080/*** ;

  其余访问路径上是错误的不可以访问。

  两种方式都测试过是可以使用的。

 

原文:http://www.cnblogs.com/DreamerLeaf/p/9842227.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值