Chetan
Chetan

Reputation: 1537

JBoss Application Server: Accessing deployed web application from another machine

I have deployed a web application on to Jboss standalone application server Version 7.1.1.

But for some reason I am not able to access the application from another machine in same network. Server is running on port 18080.

I have deployed the same application on tomcat server which is also running on the same machine, I am able to access it remotely on other machine. port number for tomcat: 8080

To verify if the port number had some issue, I just swapped the port number between the tomcat 18080 and Jboss to 8080, I can access application from tomcat but Jboss its not accessible. Thus port number is has no issue.

I have looked a bit into Jboss server standalone.xml file and tried to change the socketBinding element's interface attribute to public, still no use.

socket-binding name="http" interface="public" port="18080"

Can anybody tell me what change I need to make so that I can access these web application deployed on Jboss be accessed remotely?

Upvotes: 3

Views: 8524

Answers (3)

Tanmay kumar shaw
Tanmay kumar shaw

Reputation: 219

Make the below changes in your standalone.xml.

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

Upvotes: 3

Toni
Toni

Reputation: 1381

Alternatively, you can also define the public interface IP binding using the JBoss startup script with it's -b modifier. For example:

To bind to an specific IP:

./standalone.sh -b xxx.xxx.xxx.xxx

To bind to all the IPs:

./standalone.sh -b 0.0.0.0

The default behaviour binds only to localhost (127.0.0.1).

Upvotes: 3

Chetan
Chetan

Reputation: 1537

I got the solution to the problem, I did overlook the standalone.xml, so posted a question in hurry. Anyways this would be really helpful for others.

To make a jboss server resource remotely available, first we need to add interface attribute to soket-binding element like below:

<socket-binding name="http" interface="public" port="18080"/>
<socket-binding name="https" interface="public" port="18443"/>

Step 2: modify the interface with inet-address to have the proper IP address. XXX.XXX.XXX.XXX as shown in below code snippet

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

Upvotes: 1

Related Questions