Monday, April 6, 2015

How to change Port Offset in redhat jboss application server ( EAP/AS )



If you are using more than one application servers or if there is another server (ex: tomcat) with port 8080 you have to change port offset of the jboss application server. Because by default jboss application server starts with port 8080. So you cannot start two servers with the same port number. Then you have to give another port number other servers.

There are several ways to change port offset in jboss application server.in here considered standalone mode only. It’s different when you changing the port offset in domain mode.

Change port offset in cli


What you need to do is add additional port offset command when you running the standalone.sh/bat

[akila@localhost /]# cd /<jbossHOME>/bin
[akila@localhost bin]# ./standalone.sh -Djboss.socket.binding.port-offset=X

X is the port offset you want to add.
Ex,

[akila@localhost /]# cd /<jbossHOME>/bin
[akila@localhost bin]# ./standalone.sh -Djboss.socket.binding.port-offset=1

Now you can access the server using below url,

Change port offset by editing standalone xml


To make port offset permanently in your jboss application server, change <jbossHOME>/standalone/configuration/standalone.xml like below,

<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:X}">
        .. .
    </socket-binding-group>

X is the port offset you want to add.
Ex,

<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:1}">
        .. .
    </socket-binding-group>

Save the xml file and restart the server using below command,

[akila@localhost bin]# ./standalone.sh

Now you can access the server using below url,

1 comment:

  1. What is the command to start the server with port offset in domain mode

    ReplyDelete