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 4028428
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:13:08+00:00 2026-05-20T11:13:08+00:00

Using an Apache virtualhost and mod_proxy I want to access a java application (myapp)

  • 0

Using an Apache virtualhost and mod_proxy I want to access a java application (myapp) available in a jetty instance on port 8080.

With ProxyPass / localhost:8080/ on my apache virtualhost configuration I can access the application running in jetty with http://www.mydomain.com/myapp but I want the application to be accessed from http://www.mydomain.com.

Trying with ProxyPass / localhost:8080/myapp The application cannot be found because the request becomes http://www.mydomain.com/myappmyapp/.

Then tried with:

<Location />
        ProxyPass localhost:8080/myapp/
        SetEnv force-proxy-request-1.0 1
        SetEnv proxy-nokeepalive 1
</Location>

I can access the application but just for the first request. Subsequent requests become http://www.mydomain.com/myappmyapp/

After reading many times wiki.eclipse.org/Jetty/Tutorial/Apache and the apache mod_proxy docs the only way I managed to use the application properly from http://www.mydomain.com is with the following configuration:

<Location /myapp/>
        ProxyPass localhost:8080/myapp/
        SetEnv force-proxy-request-1.0 1
        SetEnv proxy-nokeepalive 1
</Location>

<Location />
        ProxyPass localhost:8080/myapp/
        SetEnv force-proxy-request-1.0 1
        SetEnv proxy-nokeepalive 1
</Location>

so the request is forwarded to the jetty application in both cases.

I am quite new to apache and jetty and I am pretty sure there is a better and more elegant way of achieving the same result.
In fact apache complains saying:

[warn] worker localhost:8080/myapp/ already used by another worker
  • 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-20T11:13:08+00:00Added an answer on May 20, 2026 at 11:13 am

    The problem is that when you deploy your application in jetty with the context path /myapp, it will generate all links accordingly. Apache mod_proxy does all the rewriting at the HTTP level (headers) and won’t do anything with the response body, keeping it as it is.

    If you don’t mind the /myapp sticking around, you can turn mod_rewrite on and include following two lines in your Location block:

    RewriteEngine on
    RewriteRule ^/myapp/(.*)$ /$1 [P]
    

    If you would like to get rid of /myapp for good, then the only option left (assuming you don’t want to waste CPU power on mod_proxy_html) is to configure virtual hosts, and deploy applications on virtual hosts with context path of /.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Apache's commons-httpclient for Java, what's the best way to add query parameters to
I am using Apache Axis to connect my Java app to a web server.
I'm using Apache Commons Logging and SLF4J with log4j, but I also want to
Recently I had to install a Java application for a client using Tomcat6. The
I have configured my apache 2.2 server as a simple forward proxy using mod_proxy
Using apache 2, I have a simple virtual host container: <VirtualHost 127.0.0.1> ServerName developmentServer
Using Apache POI to generate a document and i'm having a small problem with
Using Apache 2.2 and PHP 5, what's the best way to run PHP without
I am using Apache HttpClient and would like to communicate HTTP errors (400 Bad
I'm using Apache Subversion to manage and store a decent volume of code. Trying

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.