Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

3 Answers 3

Have you tried putting trailing slashes on the URLs?

eg

ProxyPass /admin-console/ http://127.0.0.1:8080/admin-console/
share|improve this answer
    
No, that doesn't work either :( –  Rich Sep 20 '10 at 13:56
up vote 0 down vote accepted

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.

share|improve this answer

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

share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.