虚拟主机或代理到web应用与Apache 2.2和Tomcat 6 [英] Virtual host or Proxy to a WebApplication with Apache 2.2 and Tomcat 6

查看:106
本文介绍了虚拟主机或代理到web应用与Apache 2.2和Tomcat 6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我与Apache 2.2(+ mod_jk的)+的Apache Tomcat 6.0服务器应用程序,工作正常。我可以向Web应用程序的主页打字 HTTP:在浏览器中// the_ip /应用。但我想在根地址 HTTP访问网页:// the_ip 。现在我越来越Tomcat的根页面
有人点我到文档或发布说明如何使用该继续吗?

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?

谢谢
彼得

推荐答案

您希望直接通过设定的webapp <​​code>应用作为默认的Web应用程序(即访问的 HTTP://本地主机:8080 / ),那么你可以设置路径上下文&LT;主机&GT; server.xml中
。这应该工作

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>

从Tomcat文档,

From the Tomcat docs,

如果您指定的一个上下文路径
  空字符串(),您要定义
  这个默认的Web应用程序
  主机,该主机将处理所有请求
  没有分配给其他上下文

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

请注意:从Tomcat 6文档的http:// tomcat的.apache.org / 建议不要因为你需要重新启动Tomcat的任何更改将这个server.xml中的tomcat-6.0-DOC /配置/ context.html#介绍。

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.

默认Web应用程序可能
  通过使用一个名为定义
  的ROOT.xml

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

但我还没有尝试过这种选择自己

but i have not tried that option myself

这篇关于虚拟主机或代理到web应用与Apache 2.2和Tomcat 6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆