Ascalonian
Ascalonian

Reputation: 15174

How can I use the hostname of the server instead of localhost with JBoss?

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.

Upvotes: 3

Views: 22222

Answers (3)

skaffman
skaffman

Reputation: 403481

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)

Upvotes: 12

mikek
mikek

Reputation: 1555

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/

Upvotes: -4

Rick Copeland
Rick Copeland

Reputation: 11902

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).

Upvotes: 1

Related Questions