JBoss WildFly:开始但不能连接?

时间:2022-09-02 20:47:32

I just configured JBoss WildFly. It is running and it is accessible from the same machine, everything is working fine...

我刚刚配置了JBoss WildFly。它正在运行,并且可以从同一台机器*问,一切都运行良好……

My problem is that it is not accessible from another system (I mean in a network, the server (hosted machine) URL can't access from another system).

我的问题是它不能从另一个系统访问(我的意思是在一个网络中,服务器(托管机器)URL不能从另一个系统访问)。

How can I solve this?

我怎么解决这个问题呢?

5 个解决方案

#1


44  

By default jboss/wildfly binding to localhost, if you want change this, you can execute:

默认情况下,jboss/wildfly绑定到localhost,如果您想要更改它,您可以执行:

standalone.sh -b 0.0.0.0

listen on all IP addresses of the machine (if multihomed)

监听机器的所有IP地址(如果是多套的)

Another alternative is configure in standalone.xml the interfaces section.

另一种选择是独立配置。xml接口部分。

Change:

变化:

<interfaces>
  <interface name="management">
   <inet-address value="127.0.0.1"/>
  </interface>
  <interface name="public">
   <inet-address value="127.0.0.1"/>
  </interface>
</interfaces>

to:

:

<interfaces>
  <interface name="management">
   <!-- Use the IPv4 wildcard address -->
   <any-ipv4-address/>
  </interface>
  <interface name="public">
   <!-- Use the IPv4 wildcard address -->
   <any-ipv4-address/>
  </interface>
</interfaces>

Ref:

裁判:

UPDATE

更新

From Wildfly 8 <any-ipv4-address/> was deprecated and remove in Wildfly 9, then if you are in 9.x or higher use <any-address/>.

从Wildfly 8 被弃用并在Wildfly 9中删除,如果您是在9中。x或更高的使用

Deprecated. In the absence of -Djava.net.preferIPv4Stack=true, the JVM cannot be instructed to bind a socket to all IPv4 addresses, but only to IPv4 addresses, so the intended semantic cannot be obtained via this setting alone. Since using any-addressType and setting -Djava.net.preferIPv4Stack=true provides the same effect, this any-ipv4-addressType will be removed in a future release.

弃用。在缺少-Djava.net.preferIPv4Stack=true的情况下,JVM不能被指示将套接字绑定到所有IPv4地址,但只能将其绑定到IPv4地址,因此无法单独通过此设置获得预期的语义。由于使用anyaddresstype和set -Djava.net.preferIPv4Stack=true提供了相同的效果,因此在以后的版本中将删除这个anyipv4 - addresstype。

Eg:

例如:

<interface name="global">
   <!-- Use the wildcard address -->
   <any-address/>
</interface>

#2


17  

The <any-ipv4-address/> is deprecated in WF 9, use:

在wf9中, 被弃用:

 ...   
    <interface name="management">
       <any-address/>
    </interface>
 ...

#3


4  

(I summary 2 answers for a working solution) I am using WildFly 10.0.0.Final - lastest version at writing time. Look for file standalone.xml like this:

On Windows

(我总结了一个工作解决方案的答案)我使用的是WildFly 10.0.0。最后-最新版本的写作时间。独立寻找文件。像这样的xml:在Windows上。

C:\tools\wildfly-10.0.0.Final\standalone\configuration\standalone.xml

Or Linux, like this:

或Linux,像这样:

/home/vyhn.net/wildfly-servlet-10.0.0.Final/standalone/configuration/standalone.xml

edit become to:

编辑成为:

<interfaces>
    <interface name="management">
        <!-- Allow all external IP -->
        <any-address/>
    </interface>
    <interface name="public">
        <!-- Allow all external IP -->
    <any-address/>
    </interface>
</interfaces>

Then go to:

然后去:

http://your_domain:9990/error/index.html

(port 9990 is default HTTP port, if you use firewall or iptables, remember open port 9990) For example:

(端口9990是默认的HTTP端口,如果您使用防火墙或iptables,请记住打开端口9990):

http://vyhn.net:9990/error/index.html

You will see it works successful.
Lastest reference (WildFly 10): https://docs.jboss.org/author/display/WFLY10/Interfaces+and+ports

你会发现它很成功。最新引用(WildFly 10): https://docs.jboss.org/author/display/wfly10/interface +和+端口。

#4


1  

Don't forget the firewall!

别忘了防火墙!

If you fixed the binding addresses and still can not connect to JBoss, try to work around the server's firewall.

如果您修复了绑定地址,仍然无法连接到JBoss,请尝试在服务器的防火墙周围工作。

To stop the firewall on Linux RHEL use this command:

若要停止Linux RHEL上的防火墙,请使用以下命令:

/etc/init.d/iptables stop

An update (April 2018):

一个更新(2018年4月):

On RHEL7, where firewalld is used (rather than iptables), you may use:

在使用firewalld(而不是iptables)的RHEL7中,可以使用:

systemctl stop firewalld

or open the specific Jboss/Wildfly ports (e.g. 8080/9990) with these two commands:

或者使用这两个命令打开特定的Jboss/Wildfly端口(例如8080/9990):

firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --reload

#5


0  

You may use -b 0.0.0.0 to allow access regardless of the public ip assigned, e.g. for computers getting dynamic IP (using DHCP), I find this a convenient way.

您可以使用-b 0.0.0.0来允许访问,而不考虑所分配的公共ip,例如,对于获得动态ip(使用DHCP)的计算机,我发现这是一种方便的方式。

Eclipse users: Beware that in Server configuration, the "Host name:" input is used to set the "-b" program argument, overriding your modifications!

Eclipse用户:请注意,在服务器配置中,“主机名:”输入用于设置“-b”程序参数,覆盖您的修改!

#1


44  

By default jboss/wildfly binding to localhost, if you want change this, you can execute:

默认情况下,jboss/wildfly绑定到localhost,如果您想要更改它,您可以执行:

standalone.sh -b 0.0.0.0

listen on all IP addresses of the machine (if multihomed)

监听机器的所有IP地址(如果是多套的)

Another alternative is configure in standalone.xml the interfaces section.

另一种选择是独立配置。xml接口部分。

Change:

变化:

<interfaces>
  <interface name="management">
   <inet-address value="127.0.0.1"/>
  </interface>
  <interface name="public">
   <inet-address value="127.0.0.1"/>
  </interface>
</interfaces>

to:

:

<interfaces>
  <interface name="management">
   <!-- Use the IPv4 wildcard address -->
   <any-ipv4-address/>
  </interface>
  <interface name="public">
   <!-- Use the IPv4 wildcard address -->
   <any-ipv4-address/>
  </interface>
</interfaces>

Ref:

裁判:

UPDATE

更新

From Wildfly 8 <any-ipv4-address/> was deprecated and remove in Wildfly 9, then if you are in 9.x or higher use <any-address/>.

从Wildfly 8 被弃用并在Wildfly 9中删除,如果您是在9中。x或更高的使用

Deprecated. In the absence of -Djava.net.preferIPv4Stack=true, the JVM cannot be instructed to bind a socket to all IPv4 addresses, but only to IPv4 addresses, so the intended semantic cannot be obtained via this setting alone. Since using any-addressType and setting -Djava.net.preferIPv4Stack=true provides the same effect, this any-ipv4-addressType will be removed in a future release.

弃用。在缺少-Djava.net.preferIPv4Stack=true的情况下,JVM不能被指示将套接字绑定到所有IPv4地址,但只能将其绑定到IPv4地址,因此无法单独通过此设置获得预期的语义。由于使用anyaddresstype和set -Djava.net.preferIPv4Stack=true提供了相同的效果,因此在以后的版本中将删除这个anyipv4 - addresstype。

Eg:

例如:

<interface name="global">
   <!-- Use the wildcard address -->
   <any-address/>
</interface>

#2


17  

The <any-ipv4-address/> is deprecated in WF 9, use:

在wf9中, 被弃用:

 ...   
    <interface name="management">
       <any-address/>
    </interface>
 ...

#3


4  

(I summary 2 answers for a working solution) I am using WildFly 10.0.0.Final - lastest version at writing time. Look for file standalone.xml like this:

On Windows

(我总结了一个工作解决方案的答案)我使用的是WildFly 10.0.0。最后-最新版本的写作时间。独立寻找文件。像这样的xml:在Windows上。

C:\tools\wildfly-10.0.0.Final\standalone\configuration\standalone.xml

Or Linux, like this:

或Linux,像这样:

/home/vyhn.net/wildfly-servlet-10.0.0.Final/standalone/configuration/standalone.xml

edit become to:

编辑成为:

<interfaces>
    <interface name="management">
        <!-- Allow all external IP -->
        <any-address/>
    </interface>
    <interface name="public">
        <!-- Allow all external IP -->
    <any-address/>
    </interface>
</interfaces>

Then go to:

然后去:

http://your_domain:9990/error/index.html

(port 9990 is default HTTP port, if you use firewall or iptables, remember open port 9990) For example:

(端口9990是默认的HTTP端口,如果您使用防火墙或iptables,请记住打开端口9990):

http://vyhn.net:9990/error/index.html

You will see it works successful.
Lastest reference (WildFly 10): https://docs.jboss.org/author/display/WFLY10/Interfaces+and+ports

你会发现它很成功。最新引用(WildFly 10): https://docs.jboss.org/author/display/wfly10/interface +和+端口。

#4


1  

Don't forget the firewall!

别忘了防火墙!

If you fixed the binding addresses and still can not connect to JBoss, try to work around the server's firewall.

如果您修复了绑定地址,仍然无法连接到JBoss,请尝试在服务器的防火墙周围工作。

To stop the firewall on Linux RHEL use this command:

若要停止Linux RHEL上的防火墙,请使用以下命令:

/etc/init.d/iptables stop

An update (April 2018):

一个更新(2018年4月):

On RHEL7, where firewalld is used (rather than iptables), you may use:

在使用firewalld(而不是iptables)的RHEL7中,可以使用:

systemctl stop firewalld

or open the specific Jboss/Wildfly ports (e.g. 8080/9990) with these two commands:

或者使用这两个命令打开特定的Jboss/Wildfly端口(例如8080/9990):

firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --reload

#5


0  

You may use -b 0.0.0.0 to allow access regardless of the public ip assigned, e.g. for computers getting dynamic IP (using DHCP), I find this a convenient way.

您可以使用-b 0.0.0.0来允许访问,而不考虑所分配的公共ip,例如,对于获得动态ip(使用DHCP)的计算机,我发现这是一种方便的方式。

Eclipse users: Beware that in Server configuration, the "Host name:" input is used to set the "-b" program argument, overriding your modifications!

Eclipse用户:请注意,在服务器配置中,“主机名:”输入用于设置“-b”程序参数,覆盖您的修改!