3

I'm trying to configure my apache 2.2 as a proxy to some applications on a server.

tomcat-jira : Installed with Jira´s installer; tomcat-dev : Just a container for another applications.

First, my httpd.conf is like this:

ProxyRequests Off
ProxyPreserveHost On

<Proxy *>
    Order deny,allow
    Allow from all
</Proxy>

ProxyPass /jira http://dev.debian.local:8080/jira
ProxyPassReverse /jira http://dev.debian.local:8080/jira

ProxyPass /tomcat http://dev.debian.local:8088
ProxyPassReverse /tomcat http://dev.debian.local:8088

<Location /jira>
    Order allow,deny
    Allow from all
</Location>

<Location /tomcat>
   Order allow,deny
   Allow from all
</Location>

So when I type http://dev.debian.local/jira it works! But in tomcat-dev, http://dev.debian.local/tomcat, it shows the page, badbly, without styles, and when I click on manage-aps, it redirect to:

http://dev.debian.local/manager/html instead of http://dev.debian.local/tomcat/manager/html causing a 404 error.

On tomcat-jira it has a parameter to configure the application that is:

Its because is just one application, so it redirects properly. How can I do something like this on tomcat instance? Is there a context path for the tomcat root?

3

1 Answer 1

4

Using ProxyPass to change the path of a web application, as you can see, usually ruins everything.

Instead, you should do either this:

ProxyPass /tomcat http://dev.debian.local:8088/tomcat
ProxyPassReverse /tomcat http://dev.debian.local:8088/tomcat

or this:

ProxyPass / http://dev.debian.local:8088
ProxyPassReverse / http://dev.debian.local:8088

If you take the second option, re-name your "tomcat" web application to "ROOT" (case-sensitive: use capitals, even on a cass-insensitive filesystem).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.