views:

2050

answers:

3

I setup JBoss 4.2.2 GA on a local server of mine. I am able to access the JBoss Application Server by going to http://localhost:8080. However, I would like to use the hostname instead of localhost so that other computers on the same network can use the server as well. When I try http://hostname:8080, or even http://192.168.1.100:8080, I get a "Page Not Found" error.

Is there some setup I am missing to enable using the hostname, or even the ip address? I appreciate everyone's help.

A: 

You want to set up Apache to handle forwarding from http://localhost:8080 to http://hostname:80

In Windows, this means adding lines of the following nature to http.conf

LoadModule proxy_module modules/mod_proxy.so

(...)

ProxyPass /jmx/ http://localhost:8080/jmx-console/
ProxyPassReverse /jmx/ http://localhost:8080/jmx-console/
mikek
-1 The question did not mention Apache or port 80; the JBoss application is running on port 8080.
Avi
@avi: OP wanted to know the easiest way to let other computers on his network access JBoss. In my opinion, that would be letting JBoss run on localhost:8080 and let Apache (which is to say the least ubiquitous) handle the forwarding. But if you consider that a poor answer it's up to you.
mikek
A: 

It looks like the JBoss server is binding only to the localhost interface. I'm not a JBoss whiz, but my first guess is that there is a config setting (close to wherever you're setting the port to 8080) that says to bind to IP address 127.0.0.1. Try changing this to 0.0.0.0 to bind to all interfaces on the machine, or to 192.168.1.100 to only bind to the network interface (and not localhost).

Rick Copeland
+3  A: 

By default, JBoss only binds to localhost. This is a security default.

The easiest way to change this is to launch JBoss with the -b flag, telling it which address to bind to, for example

run.bat -b 192.168.1.100

(or using whichever startup script you're using)

skaffman
use run.bat -b 0.0.0.0 instead, so jboss will bind on all ip adresses.
Luke
If that's what you want to achieve, yes. I wouldn't recommend it, though.
skaffman
Just out of curiosity, why would you not recommend it?
Ascalonian
Because as a general rule, it's good to know exactly what you're exposing your server to. JBoss generally ends up sitting behind a web server proxy, and so listening on a single address is sufficient.
skaffman
@skaffman this worked perfectly. Thank you.
Ascalonian