Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 894579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:24:52+00:00 2026-05-15T14:24:52+00:00

Recently I had to install a Java application for a client using Tomcat6. The

  • 0

Recently I had to install a Java application for a client using Tomcat6. The application needed to run from the root of their domain so I also installed apache2 and mod_proxy_ajp to set up a proxy to make this work. After a bit of massaging and googling to deal with Location Headers including the original path of the servlets rather than the proxy root. I’ve come up with this.

<VirtualHost *:80>
        ServerName myclientssite.com
        ErrorLog /var/log/apache2/ajp.error.log
        CustomLog /var/log/apache2/ajp.log combined

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

        ProxyRequests Off
        ProxyPass / ajp://localhost:8009/appname/
        ProxyPassReverse / http://localhost:8080/appname/
        ProxyPassReverseCookiePath /appname/ /

        Header edit Location ^([^/]*//[^/]*)?/appname/(.*)$ $1/$2
</VirtualHost>

My question is wither this is the the best solution. It seems with out mod_headers and the Header edit line and headers will usually include the appname subdirectory.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T14:24:52+00:00Added an answer on May 15, 2026 at 2:24 pm

    Is the Java application building its Location headers from the information in the request (rather than from some explicit configuration)? In this case, it should get the location right if you use ProxyPreserveHost On.

    The case where you’d need the to change the header is if your Apache Httpd frontend is over HTTPS and the connection from Apache Httpd to the Java container is over plain HTTP or AJP. Not that, in theory (and that might not always be the case in practice), the Location header requires an absolute URI, so you might not need such a complex expression if you already know the hostname.

    I’d also suggest using an HTTP reverse proxy rather than AJP (it’s quite similar in the end, but it seems to have more support).

    ProxyRequests Off
    ProxyPass /appname/ http://localhost:8080/appname/
    ProxyPassReverse /appname/ http://localhost:8080/appname/
    ProxyPreserveHost On
    
    # If you're using HTTPS
    Header edit Location ^http://www.example/appname/ https://www.example/appname/
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently had to re-install Glassfish 3.1.2 from scratch and I found myself spending
I recently had my free application published in Mac Appstore. I'm trying to find
I recently had an idea to create my own String class to make using
When installing rJava using the install.packages(rJava) command I get the following error: checking Java
I've been using GAE for months now, but very recently I've had difficulty getting
I am an app developer, and I recently had to re-install windows, so I
I've recently had to uninstall/re-install my .NET Framework 4 after finding my current installation
Pair.net recently upgraded our PHP install and afterwards client started see HTML in email
I've recently had to re-install all my SDKs etc. on my new HDD, and
I have recently installed a new project into my Eclipse and also needed to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.