开发者

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

开发者 https://www.devze.com 2023-01-11 03:12 出处:网络
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 t

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开发者_JS百科 Peter


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

0

精彩评论

暂无评论...
验证码 换一张
取 消