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

Ask A Question

Stats

  • Questions 529k
  • Answers 529k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If it's specific to the interface, put in interface. If… May 16, 2026 at 11:11 pm
  • Editorial Team
    Editorial Team added an answer I've just found this article. It appears o2's proxy cache… May 16, 2026 at 11:11 pm
  • Editorial Team
    Editorial Team added an answer You can use a loop, checking for indexes of '/'… May 16, 2026 at 11:11 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

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 recently had an issue after upgrading my .net framework to 4.0 from 3.5:
Using PHP / MySQL all encoded up as UTF, we have recently had to
I recently had to reinstall subversion on my hosting account. The repository I had
I recently had a program fail in a production server because the server was
Summary I recently had a conversation with the creator of a framework that one
Recently I had a problem in a costumer's computer. Our installer would hang during
We recently installed Team Foundation Server 2008 and we are using it for both
I recently installed (from the binary installers) GHC 6.12 and the Haskell Platform 2010.1.0.1

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.