stefanopulze
stefanopulze

Reputation: 59

Apache ProxyPass Tomcat

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

Upvotes: 0

Views: 885

Answers (2)

MikePatel
MikePatel

Reputation: 2672

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>

Upvotes: 0

Jon Lin
Jon Lin

Reputation: 143846

Your proxpass directives should be:

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

Upvotes: 1

Related Questions