Topic: [Tomcat求助]如何安装webapp到tomcat外部的目录?

  Print this page

1.[Tomcat求助]如何安装webapp到tomcat外部的目录? Copy to clipboard
Posted by: jfml
Posted on: 2003-07-11 11:07

请指教

谢谢

2.Re:[Tomcat求助]如何安装webapp到tomcat外部的目录? [Re: CrazyJavar] Copy to clipboard
Posted by: why
Posted on: 2003-07-11 12:22

server.xml
<Context path="/myPath" docBase="C:\myFolder" ...>
perhaps it needs \\

3.Re:[Tomcat求助]如何安装webapp到tomcat外部的目录? [Re: CrazyJavar] Copy to clipboard
Posted by: jfml
Posted on: 2003-07-11 12:44

可否给个完整的

谢谢

4.Re:[Tomcat求助]如何安装webapp到tomcat外部的目录? [Re: CrazyJavar] Copy to clipboard
Posted by: why
Posted on: 2003-07-11 13:31

check the server.xml in [TOMCAT_HOME]/conf for a complete Context example -- maybe commented out, modify it to use absolute path

Reference: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/context.html

5.Re:[Tomcat求助]如何安装webapp到tomcat外部的目录? [Re: CrazyJavar] Copy to clipboard
Posted by: redmiddle
Posted on: 2003-07-12 09:58

maybe你也可以增加一个service在server.xml里面.例子如下.
<Service name="Test(其实这个名字无所谓,养眼的)">
<!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8002(这个8002端口我自己定义的.也随便你.不过好像某些端口不稳定倒是真的.) -->
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8002(这个端口就是我新加的)" minProcessors="5" maxProcessors="100"
enableLookups="false"
acceptCount="200" debug="0" connectionTimeout="20000"
useURIValidationHack="false" disableUploadTimeout="true" />
<!-- Note : To disable connection timeouts, set connectionTimeout value
to -1 -->

<!-- Define the top level container in our container hierarchy -->
<Engine name="HandleUser" defaultHost="localhost" debug="0">

<!-- Global logger unless overridden at lower levels -->
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="user_log." suffix=".txt"
timestamp="true"/>
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
debug="0" resourceName="UserDatabase"/>
<!-- Define the default virtual host -->
<Host name="localhost" debug="0" appBase="你的程式路径D:\yourWebApp">
<!-- Tomcat Root Context -->
<Context path="" docBase="" debug="0"
reloadable="true" crossContext="true">
</Context>
</Host>
</Engine>
</Service>

注意,我在这里面加了注释.要看清楚

6.Re:[Tomcat求助]如何安装webapp到tomcat外部的目录? [Re: CrazyJavar] Copy to clipboard
Posted by: jfml
Posted on: 2003-07-15 15:47

先谢谢各位的指点
我在server.xml中增加了

<Context path="/mywebapp" docBase="D:\mywebapp" debug="0" reloadable="true" crossContext="true"/>

就可以了

不过在运行servlet中出现了问题,servlet中认为wsspec.jnlp文件在下面的路径中

D:\tomcat\bin\webapps\mywebapp\wsspec.jnlp
org.dom4j.DocumentException: D:\tomcat\bin\webapps\mywebapp\wsspec.jnlp (系统找不
到指定的路径。) Nested exception: D:\tomcat\bin\webapps\mywebapp\wsspec.jnlp (系统
找不到指定的路径。)

如何才能把jnlp的路径改正到D:\mywebapp目录呢

7.Re:[Tomcat求助]如何安装webapp到tomcat外部的目录? [Re: CrazyJavar] Copy to clipboard
Posted by: jfml
Posted on: 2003-07-15 15:50

第二个疑问:

我修改server.xml可以成功的install webapp

但是我在manager页面中install webapp后,server.xml并没有发生变化

请问tomcat中所有web app的信息到底存放在哪里呢?

8.Re:[Tomcat求助]如何安装webapp到tomcat外部的目录? [Re: CrazyJavar] Copy to clipboard
Posted by: why
Posted on: 2003-07-15 17:00

CrazyJavar wrote:
但是我在manager页面中install webapp后,server.xml并没有发生变化

there's no change since by default the installed webapp's auto-deployed:
<Host appBase="webapps" autoDeploy="true" ...>

9.Re:[Tomcat求助]如何安装webapp到tomcat外部的目录? [Re: CrazyJavar] Copy to clipboard
Posted by: wes109
Posted on: 2003-07-18 08:38

没那么麻烦
我喜欢的做法是:

在webapps目录下放一个myweb.xml (名字随便起了:)),里面的内容你可以参考

此目录下的admin.xml 和manager.xml

<!--

Context configuration file for the Tomcat Administration Web App

$Id: admin.xml,v 1.3 2002/07/23 12:12:15 remm Exp $

-->

<Context path="/admin" docBase="../server/webapps/admin"
debug="0" privileged="true">

<!-- Uncomment this Valve to limit access to the Admin app to localhost
for obvious security reasons. Allow may be a comma-separated list of
hosts (or even regular expressions).
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
allow="127.0.0.1"/>
-->

<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_admin_log." suffix=".txt"
timestamp="true"/>

</Context>


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923