Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change Wildfly server's IP address

I'm working on preparing a program that runs on Wildfly for deployment to a customer site, and I need to change the IP address that Wildfly launches on. How do I configure Wildfly to start up at, for example, 127.0.0.2 instead of 127.0.0.1?


Update

I'm running Wildfly as a service on Windows.

like image 829
jpyams Avatar asked Jul 27 '15 16:07

jpyams


People also ask

How do I bind WildFly to an IP address?

To bind WildFly to a particular address, launch it with the -b flag: ${WILDFLY_HOME}/bin/standalone.sh -b=0.0. 0.0 (see e.g. Docklands Wildfly image).

How do I change my WildFly port number?

The default WildFly port can be changed by setting the system property jboss. http. port – while starting the server.

Where is WildFly configuration file?

Each Host Controller by default reads its configuration from the domain/configuration/host. xml file located in the unzipped WildFly installation on its host's filesystem. The host. xml file contains configuration information that is specific to the particular host.


2 Answers

Either you can bind the address through passing the arguments while starting the server like

./standalone.sh -c standalone-full.xml -b=127.0.0.2

https://sourcevirtues.wordpress.com/2013/12/09/set-wildfly-binding-address-and-shutdown-from-cli/

or it can be configured in host.xml file

<interface name="public">

    <inet-address value="${jboss.bind.address:127.0.0.2}"/>

</interface>

http://www.mastertheboss.com/jboss-server/jboss-configuration/how-to-access-jboss-as-over-a-network

Update : To run as service, you will need to set some variables in service.bat as well

set CONTROLLER=localhost:9990 // here set your ip:9990 and other required details

    set DC_HOST=master
    set IS_DOMAIN=false
    set LOGLEVEL=INFO
    set JBOSSUSER=admin  //management admin user
    set PASSWORD=pwd  //management admin password
like image 141
happy Avatar answered Oct 27 '22 14:10

happy


You could set different ip address by changing public interface in the standalone.xml file. It should look like this:

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

So, the server is now listening only on the specified ip address (after restarting). If you want allow all available network interfaces, you should place 0.0.0.0 instead (be careful with this).

like image 35
akelec Avatar answered Oct 27 '22 12:10

akelec