Java JBoss 绑定 IP 地址

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1505424/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 13:34:30  来源:igfitidea点击:

JBoss Binding IP addresses

javatomcatbindingjbossjira

提问by jeph perro

I need some help from someone who understands JBoss Hostname Binding. I think the solution is easy, although it's complicated to explain.

我需要了解 JBoss 主机名绑定的人的帮助。我认为解决方案很简单,尽管解释起来很复杂。

I am deploying an application using JBoss (v4.2) and am having troubles configuring the application.

我正在使用 JBoss (v4.2) 部署应用程序,但在配置应用程序时遇到问题。

This application has two parts, a web site on port 8080 and web services on port 8080 using SOAP APIs.

这个应用程序有两个部分,一个是在端口 8080 上的网站,另一个是在端口 8080 上使用 SOAP API 的 Web 服务。

My server sits behind a firewall, and has an alias, let's say it's called orange.mycompany.com

我的服务器位于防火墙后面,并有一个别名,假设它叫做orange.mycompany.com

My problem is that I cannot get the console to connect to the web services. The website works, but I see an connection refused error connecting to the web services.

我的问题是我无法让控制台连接到 Web 服务。该网站工作正常,但我看到连接到 Web 服务的连接被拒绝错误。

[xfire.transport.http.HttpChannel] java.net.ConnectException: Connection refused

[xfire.transport.http.HttpChannel] java.net.ConnectException:连接被拒绝

There are 2 things I can control, the bind IP on Tomcat, and the URL of the web services.

我可以控制两件事,Tomcat 上的绑定 IP 和 Web 服务的 URL。

If I start JBoss, and bind to the local IP address:

如果我启动 JBoss,并绑定到本地 IP 地址:

./run.sh -b 10.1.2.3

And I set the URL of the web services to be that same IP

我将 Web 服务的 URL 设置为相同的 IP

url=http://10.1.2.3:8080/services

I can see the website on port 8080 from outside the firewall, but the console cannot connect to webservices. From the server, orange, itself I cannot see the website by calling http://localhost:8080/or http://10.1.2.3:8080or orange.mycompany.com:8080

我可以从防火墙外部看到 8080 端口上的网站,但控制台无法连接到 web 服务。从服务器,orange,本身我无法通过调用http://localhost:8080/http://10.1.2.3:8080或 orange.mycompany.com:8080看到该网站

However, if I start JBoss and bind to 127.0.0.1:

但是,如果我启动 JBoss 并绑定到 127.0.0.1:

./run.sh -b 127.0.0.1

And I set the URL of the web services to localhost

我将 Web 服务的 URL 设置为 localhost

url=http://localhost:8080/services

Now I can't see the website at all from outside the firewall. But from the server itself, I can see the website browsing http://localhost:8080and the I can successfully connect to the web services. That's great, but I need the website to be accessible from outside.

现在我在防火墙之外根本看不到该网站。但是从服务器本身,我可以看到网站浏览http://localhost:8080并且我可以成功连接到 Web 服务。太好了,但我需要可以从外部访问该网站。

Can anyone suggest any combination of settings that will let me browse the website and also let the console call webservices on localhost?

任何人都可以提出任何可以让我浏览网站并让控制台调用本地主机上的 web 服务的设置组合吗?

采纳答案by jeph perro

Never mind.

没关系。

Start JBoss binding to all IP's works.

启动 JBoss 绑定到所有 IP 的作品。

./run.sh -b 0.0.0.0

回答by jeph perro

Aren't your running JIRA standalone, right?

您运行的 JIRA 不是独立运行的,对吗?

I always run tomcat and jboss behind a apache with mod_jk. This still hide ports, what sounds great for newbies users.

我总是在带有 mod_jk 的 apache 后面运行 tomcat 和 jboss。这仍然隐藏了端口,这对新手用户来说听起来很棒。

Your server is behind a NAT?

您的服务器在 NAT 后面?

Sometimes I use ProxyPass or RewriteRules (mod_rewrite) to provide external access, thru reverse proxy.

有时我使用 ProxyPass 或 RewriteRules (mod_rewrite) 来提供外部访问,通过反向代理。