Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Trying to set http://localhost to load one tomcat project?

Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I'm a real noob when it comes to apache and tomcat configs...

I've got an java app: myapp in myapp.war

I'm running apache 2.2 running on port 80 with mod_rewrite installed
I'm running tomcat 5.5 running on port 8083

I'd like to configure my web/app servers so when I go to http://localhost/ it knows to load http://localhost:8083/myapp from tomcat.

The reason I'm trying to get this done is eventually it's going to be out on the web at and I will want that to load from the tomcat /myapp/ context without changing the URL -- IE I DO NOT want it to just "forward" to a new URL, I'd like it to keep the URL the same but load from /myapp on tomcat.

Will I need mod_rewrite to do this? Is there a way to do this via ProxyPass command?

Also just to clarify, I'd like it to work so that any urls that would normally be http://localhost:8083/myapp/* could be accessed via http://localhost/* -- ie http://localhost/css/mycss.css should be found in http://localhost:8083/myapp/css/mycss.css and my strust2 actions classes should still work at http://localhost/MyAction.action etc.

[ September 02, 2007: Message edited by: Aaron Wilt ]
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Aaron,

You might want to try the mod_jk method instead of the rewrite. That way all you need to do would be:
1. Change/put in a couple of lines in the httpd.conf file
2. Download the or mod_jk.dll (depending upon your platform) and place it in your /modules/ folder of Apache
3. Put in a couple of lines in the file of your Tomcat installation.
4. Put in the attribute "jvmRoute" in your Tomcat's server.xml file

You can refer to this site: []

This is quite a simple way of setting up an Apache web server before your Tomcat. The configuring part is actually easier than it looks.

If you need further assistance post in. Hope this helps!
    Bookmark Topic Watch Topic
  • New Topic