如何使用JBoss AS 7在Internet上部署应用程序 [英] How to deploy an application over the internet with JBoss AS 7

查看:72
本文介绍了如何使用JBoss AS 7在Internet上部署应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用JBoss 7 AS.我正在通过cmd的linux框部署项目,像这样

I am using JBoss 7 AS. I am deploying the projects via the linux box by the cmd like so

bin/standalone.sh -b [ipaddress]

bin/standalone.sh -b [ipaddress]

仅当我在网络上时,此方法才能正常工作,但是当我在网络之外或通过Internet时,此方法不起作用.

This works fine only when i am on the network, however it doesn't work when i'm outside the network or over the internet.

我如何启动它,以便人们可以通过Internet访问它?

How do i launch it so people can access it over the internet?

我尝试了这个,但是没有用.

I tried this but it doesnt work.

bin/standalone.sh -b 0.0.0.0

bin/standalone.sh -b 0.0.0.0

它说:

Google Chrome无法加载网页,因为响应时间太长.该网站可能已关闭,或者您的Internet连接出现问题.

Google Chrome could not load the webpage because took too long to respond. The website may be down, or you may be experiencing issues with your Internet connection.

推荐答案

您的第一步是了解和配置接口和端口绑定.在此之前,应先弄清楚-b运行时开关自JBoss AS7.0.2起一直处于活动状态,但在AS 7的先前发行版中不存在.请参见以下链接,以通过JBoss应用程序获取更多信息. Server 7社区论坛.

Your first step is to understand and configure your interface and port bindings. Before we get to that, it should be clarified that the -b runtime switch has been active since JBoss AS7.0.2, but wasn't present in previous releases of AS 7. Refer to the following link for more information via the JBoss Application Server 7 community forums.

https://community.jboss.org/thread/168789

对于您的问题,您将需要同时考虑套接字绑定组的接口和端口属性.假设您使用的是独立实例,则可以找到在standalone.xml配置文件中声明的套接字绑定组,如下所示.

For your question, you will need to consider both the interface and the port attribute of the socket binding group. Assuming that you're using the standalone instance, you can find the socket binding groups declared in the standalone.xml configuration file as follows.

<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
    <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>
    <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
    <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/>
    <socket-binding name="ajp" port="8009"/>
    <socket-binding name="http" port="8080"/>
    <socket-binding name="https" port="8443"/>
    <socket-binding name="osgi-http" interface="management" port="8090"/>
    <socket-binding name="remoting" port="4447"/>
    <socket-binding name="txn-recovery-environment" port="4712"/>
    <socket-binding name="txn-status-manager" port="4713"/>
    <outbound-socket-binding name="mail-smtp">
        <remote-destination host="localhost" port="25"/>
    </outbound-socket-binding>
</socket-binding-group>

您可以看到http连接器已绑定到端口8080,还可以看到管理API端口绑定已绑定到Java令牌.这些是可以覆盖的值(因此"${thing:value}"语法),但是如果对它们进行硬编码,则将失去覆盖它们的能力.这是相关的,因为默认接口是Java令牌,允许您使用-b开关覆盖它.

You can see that the http connector is bound to port 8080, and you can also see that the management API port bindings are bound to java tokens. These are values that you can override (hence the "${thing:value}" syntax), but you lose the power to override them if you hardcode them. This is relevant because the default interface is a java token, allowing you to use the -b switch to override it.

这是standalone.xml文件中的默认公共接口. 公共"一词只是一个相对的句柄.您可以将其调用"为所需的任何内容,只要它对您有意义,就可以在以后将服务器组和套接字绑定关联到该名称.这是AS 7的一项重要功能,允许您在一个元素中声明一组属性,并通过引用该元素名称在其他位置继承它们的属性.

Here's the default public interface in the standalone.xml file. The word "public" is just a relative handle. You can "call" it anything that you want, just as long as it means something to you and you can associate server groups and socket bindings to it later. This is a great feature of AS 7, allowing you to declare a set of attributes in one element, and inherit their attributes elsewhere by referencing that element name.

下面的示例使您可以在其他地方引用public接口,而无需知道实际的Inet Address值是什么.

The following example allows you to reference the public interface elsewhere without needing to know what the actual Inet Address value is.

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

变得黏糊糊

您可以通过管理CLI或管理控制台来更改这些值(遵循工作流指南,最好使用管理API而不管XML).像大多数GUI一样,管理控制台是最容易进入的.这是套接字绑定屏幕.注意,在独立实例中实际上只有一个套接字绑定组",在本例中为standard-sockets组.

如果需要,您可以编辑http绑定,但是您还应该考虑用于连接到Internet的接口.我将假设您已经设置了适合自己需要的Web服务器(这对Apache而言可能比JBoss更为重要).这是界面设置的控制台视图.

You can edit the http binding if you need, but you should also think about the interface that you are using to connect to the internet. I'm going to assume that you have set up your webserver to suit your needs (which is probably more a question for apache than JBoss). Here's the console view for interface settings.

这显示了public绑定组在配置文件中与之相关的public接口.高级配置可以使用高级"部分来创建用于对流量进行分区的有序条件.您甚至可以启用我上面发布的第一个链接中描述的<any-address/>元素.

This shows the public interface that the standard-sockets binding group is relating itself to in the config file. Advanced configurations can use the Advanced section to create ordered conditions for partitioning traffic. You can even enable the <any-address/> element that is described in the first link I posted above.

在这两个屏幕上,您应该能够配置所需的接口和端口绑定,以将您的应用程序公开到Internet.

From these two screens, you should be able to configure the required interface and port bindings to expose your application to the internet.

这篇关于如何使用JBoss AS 7在Internet上部署应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆