0

I know this is in Apache & JBoss Configuration 101 but I just can't work it out.

I am configuring Apache 2.2.3 to use mod_proxy_http to forward requests to JBoss 5.1.0 GA. The idea being that there will be multiple JBoss instances fronted by a single Apache.

Both JBoss and Apache are on the same physical box.

I have a configuration file in conf.d which reads as follows:

Listen 8087
<VirtualHost *:8087>
    ProxyRequests Off
    <Proxy *>
            Order deny,allow
            Allow from all
    </Proxy>

    ProxyPass /admin-console http://127.0.0.1:8080/admin-console
    ProxyPassReverse /admin-console http://127.0.0.1:8080/admin-console

    <Location /admin-console>
            Order deny,allow
            Allow from all
            Options -Indexes FollowSymLinks
    </Location>

</VirtualHost>

And I have JBoss listening on port 8080 bound to 127.0.0.1.

If I visit http://myServer:8087/admin-console I get the login prompt but the images are missing. If I then enter the username and password the browser gets redirected to:

http://127.0.0.1:8080/admin-console/login.seam

So, obviously JBoss is sending URLs for images/CSS/etc and the login.seam page which are localhost.

How do I change this? Is it a configuration in Apache, or should I change JBoss somewhere? If this is a change in JBoss, I would like it to be a global change as we will be installing many apps on each JBoss instance. Crucially I don't want JBoss to bind to the server's hostname so that it can be accessed directly at http://myServer:8080/admin-console.

Thanks in advance

Rich

Rich
  • 1,343
  • 7
  • 28
  • 39

3 Answers3

1

I think I've got it:

    <Location /admin-console>
            Order deny,allow
            Allow from all
            Options -Indexes FollowSymLinks
            ProxyPass http://127.0.0.1:8080/admin-console
            ProxyPassReverse http://127.0.0.1:8080/admin-console
    </Location>

I needed to put the ProxyPass and ProxyPassReverse directives inside the Location directive.

Rich
  • 1,343
  • 7
  • 28
  • 39
0

Have you tried putting trailing slashes on the URLs?

eg

ProxyPass /admin-console/ http://127.0.0.1:8080/admin-console/
jamespo
  • 1,698
  • 12
  • 12
0

If you can run like ip address of you box run.sh -b 192.168.1.100 then check again.

Lucas Kauffman
  • 16,880
  • 9
  • 58
  • 93
Rajat
  • 3,349
  • 22
  • 29
  • That doesn't work because it makes JBoss visible @ 192.168.1.100:8080 and I don't want that. – Rich Sep 20 '10 at 14:31