Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wildfly standalone in local network

I need some way to give access to my web application frontend (which is on localhost:8080 by default) to local network users (192.168.x.y). Assuming that my ip is 192.168.1.72, I want other client in my network could view my application frontend in his browser by typing 192.168.1.72:8080 in address bar. Is there any way to launch Wildfly standalone instance in my local network instead of localhost? Or is there another solution (maybe I could somehow connect my address in local network to localhost)? Sorry for silly quiestion

like image 280
Everv0id Avatar asked Feb 02 '15 20:02

Everv0id


People also ask

How do I start WildFly in standalone mode?

To start up a WildFly 8 managed domain, execute the $JBOSS_HOME/bin/domain.sh script. To start up a standalone server, execute the $JBOSS_HOME/bin/standalone.sh. With no arguments, the default configuration is used.

What is WildFly standalone?

WildFly in the standalone mode means a WildFly instance is launched and managed on its own. You can have as many standalone WildFly instances as you like, but you will have to manage them separately. This means that every configuration, datasource, deployment, and module has to be managed once per instance.

Where is standalone XML in WildFly?

If you look in the $JBOSS_HOME/docs/schema there are several schemas that make up the standalone. xml file. standalone. xml file contains all the information regarding modules used by the JBOSS or wildfly.


2 Answers

The standalone.bat/standalone.sh startup scripts accept a bind parameter so you can bind the application server to specific IP addresses for incoming requests.

For example standalone.bat -b 0.0.0.0 will start Wildfly listening on all your IP addresses.

Possible parameters: 0.0.0.0 for all IP addresses, 127.0.0.1 to listen just on localhost, 192.168.1.72 to listen just on your LAN IP (then even from your local machine you need to enter the LAN IP). Note: This only changes the IP it's listening on, the port remains 8080 or whatever you have configured.

You have -b parameter for normal client serving bind address an you also have -bmanagement for the management interface. This is the interface on which you can connect to the admin console via browser or via remote protocols.

Even if you give remote access to the web applications inside it's good to reserve the management interface just for you. So for example:

standalone.bat -b 0.0.0.0 -bmanagement 127.0.0.1 will enable anyone to connect but only local connections for management.

like image 156
Cristian Vat Avatar answered Oct 01 '22 14:10

Cristian Vat


If you want to do this "manually", you could set a different IP address by changing the public interface in the standalone.xml file. It should look like this:

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

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

like image 40
akelec Avatar answered Oct 01 '22 15:10

akelec