Question

I have some trouble with Apache and Tomcat server inside same machine. I want redirect a virtual host, kb.domain to an tomcat app kb.

I have read some post on internet but I don't found a solution to my problem.

My configuration have one Apache server (http://domain) and in same machine an tomcat server (http://domain:8080); in my Apache I have mapped a VirtualHost that respond to kb.domain like this:

    <VirtualHost *:80>
    ServerName kb.domain

    <Location />
    ProxyPass http://192.168.200.3:8080/kb
    ProxyPassReverse http://192.168.200.3:8080/kb
    </Location>
    </VirtualHost>

When I call the kb.domain url from browser he add an extra / at the end and go into redirect loop.

Can anyone help me?

Thanks

Was it helpful?

Solution

Your proxpass directives should be:

ProxyPass / http://192.168.200.3:8080/kb/
ProxyPassReverse / http://192.168.200.3:8080/kb/

OTHER TIPS

try

<VirtualHost *:80>
    ServerName kb.domain

    ProxyPass /kb http://localhost:8080/kb
    ProxyPassReverse /kb http://localhost:8080/kb

</VirtualHost>

If you want to pass regardless of path ( aka not /kb )

<VirtualHost *:80>
    ServerName kb.domain

    ProxyPass / http://localhost:8080
    ProxyPassReverse / http://localhost:8080

</VirtualHost>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top