After you start your Tomacat/Apache HTTPD Server:
just go to the command line and use netstat -an command to check the network statistics. You might have noticed
foobar:~ nrs$ netstat -an | grep LISTEN
tcp46 0 0 *.8080 *.* LISTEN
tcp4 0 0 192.168.2.101.3873 *.* LISTEN
that the listening port is listed as either *.8080 or 0.0.0.0:8080.
Basically this means that your server is listening for connection from all the network interfaces in your machine. i.e. if you have Wi-Fi, ethernet or couple of other VirtualMachine ethernet port configured. Then you can reach the server using any of those interfaces (IP address).
You could reach the server using 127.0.0.1 (local host), and any IP address of one of the network interfaces you have. So even when you write socket programming code, use the server host address as 0.0.0.0 if you want that your server to be reachable through all the interfaces.
You could also use the same feature to gain precise control of how your application can be reached. When you start the server in production or other critical environments it just be better that the server listens only in single IP address that is the expected interface for reaching the service.
In JBoss application server you can control this attribute either in the configuration file, or through system property jboss.bind.address. This property can also have multiple values separated by comma (i.e. jboss.bind.address=127.0.0.0,232.213.232.12). This helps to control precisely through which interface your service were accessible.
C:\jboss-home\bin>.\run.bat -Djboss.bind.address=0.0.0.0 -c default
Could you please explain in more detail what is the problem in binding JBoss (for example) in 0.0.0.0 ?
Thanks in advance.
There is no problems such as, but its recommended not to bind on all ports on a production machine. By binding it to all interfaces, you just need to aware the ways the application can be reached and protect additional interfaces if required.
I believe earlier version of JBoss did used 0.0.0.0 option by default, and then this feature is made as non-default option as people just use the same configuration in production.
hi
i did’nt know what is the meaning of 0.0.0.0 .
thanks for sharing useful information
Hi! I was looking for meaning of 0.0.0.0 and you was so clear!
Please tell me if it is ok:
0.0.0.0 includes:
1) localhost 127.0.0.1
2) IPs of every fisical NIC installed (like 192.168.0.X)
3) IPs of every virtual NIC (for example of any VM running)
Is it right?
Any other possibilities?!
Thank you for all anyway!
James
yes you are right. That’s all. You can run ipconfig command in windows; or ifconfig on linux to get the current list of such ip addresses.