tags:

views:

32

answers:

1

I have a server app with Apache 2.2 (+mod_jk) + Apache Tomcat 6.0 that works fine. I can get to the web application's home page typing http://the_ip/application in the browser. But I want to access that page at the root address http://the_ip. Right now I am getting Tomcat's Root page Can someone point me to a doc or posting that explains how to proceed with this?

Thanks Peter

+1  A: 

You want to set webapp application as the default web app (i.e. access it directly via http://localhost:8080/), then you can set the path as "" in Context within <Host> in server.xml . This should work

<Context docBase="/var/lib/tomcat6/webapps/application/" path="" reloadable="true>

From the Tomcat docs,

If you specify a context path of an empty string (""), you are defining the default web application for this Host, which will process all requests not assigned to other Contexts

Note: From the Tomcat 6 docs http://tomcat.apache.org/tomcat-6.0-doc/config/context.html#Introduction it is recommended not to put this in server.xml since you need to restart Tomcat for any changes.

The default web application may be defined by using a file called ROOT.xml

but i have not tried that option myself

JoseK
Nope. It doesn't work this way. I guess I'll have to proxy it from Apache
peter
Peter: does it still show the default tomcat page if you hit it without apache?
JoseK
Actually I've made it work with your suggested solution. The only modification to it is that I had to add <b>override="true"</b> as per the apache documentation. Also as a side note, I am using Apache 2.2 as the web server and mod_jk to proxy to Tomcat 6 so that the configuration did not take effect right away. I had to first stop Tomcat, then stop Apache, start Tomcat, and start Apache to flush out the caches that mod_jk may use.Thanks for your suggestion. Peter
peter
Ah, good point on restarting Apache and Tomcat too. Glad it worked.
JoseK