How to deploy an application over the web using JBoss AS 7

I am using JBoss 7 AS. I am deploying projects via linux window using cmd as follows

bin / standalone.sh -b [ipaddress]

This only works fine when I am online, however it does not work when I am offline or over the Internet.

How can I get it running so people can access it over the internet?

I tried this but it doesn't work.

bin / standalone.sh -b 0.0.0.0

It says:

Google Chrome was unable to load the webpage because it took too long to respond. The website may be unavailable, or you may encounter problems with your internet connection.

+3


source to share


3 answers


Your first step is to understand and configure the interface and port bindings. Before we get to that, it should be clarified that the runtime switch -b

was active with JBoss AS7.0.2, but was not present in previous versions of AS 7. For more information using the JBoss app, see the following Server 7 Community Forums link.

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

For your question, you will need to consider both the interface and the port attribute of the socket binding group. Assuming you are using a standalone instance, you can find the socket binding groups specified in the config file standalone.xml

as shown below.

Socket Groups and Port Bindings

<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>

      

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 syntax "${thing:value}"

), but you lose the ability to override them if you hardcode them. This is relevant because the default interface is a java token, allowing you to use a switch -b

to override it.

Interfaces

This is where the default public interface is located in the file standalone.xml

. The word "public" is just a relative pen. You can "name" whatever you want as long as it means something to you, and you can later associate it with server groups and sockets. This is a great AS 7 feature that allows you to declare a set of attributes in one element and inherit their attributes elsewhere, referencing that element name.

In the following example, you can refer to an interface public

elsewhere without knowing what the actual value of the Inet Address is.



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

      

Getting Gooey

You can change these values ​​either using the management CLI or using the management console (according to the workflow guide, it is better to use the management API and leave only XML). As with most GUIs, the Management Console is the easiest to navigate first. Here's the socket binding screen. Note that there is only one "socket binding group" per instance, in this case the group standard-sockets

.

Socket binding groups in the Management Console

You can edit the binding http

if you need to, but you should also think about the interface you use to connect to the Internet. I'm going to assume that you've configured your webserver to suit your needs (which is more likely a question for Apache than JBoss). This displays a console view for interface settings.

Interface settings in the Management Console

Shown here is the interface public

that binds the binding group standard-sockets

in the config file. Advanced configurations can use the Advanced section to create orderly conditions to separate traffic. You can even include the element <any-address/>

described in the first link posted above.

On these two screens, you will be able to configure the required interface and port bindings to open the application on the Internet.

+7


source


Binding -b 0.0.0.0

does not work in JBoss AS7. Instead, you need to configure the interfaces in standalone/configuration/standalone.xml

.



<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:<your-public-ip>}"/>
    </interface>
</interfaces>

      

0


source


As I cannot comment on drri's answer, I add a note as an answer.

When configuring more port bindings, you must also add a connector to it inside

<subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false">

      

as follows, when you add a named binding some-binding

to a port 10000

, you specify it as:

        <socket-binding name="some-binding" port="10000"/>

      

and then add the appropriate connector:

<connector name="some-binding" protocol="HTTP/1.1" scheme="http" socket-binding="some-binding"/>

      

0


source







All Articles