简体   繁体   中英

Virtual host or Proxy to a WebApplication with Apache 2.2 and Tomcat 6

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

You want to set webapp application as the default web app (ie 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM