Windows 下的 Apache Tomcat:更改 webapps 默认目录 [英] Apache Tomcat under Windows: Changing webapps default directory

查看:30
本文介绍了Windows 下的 Apache Tomcat:更改 webapps 默认目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Ant 部署我的 Java 应用程序.不幸的是,由于 Vista,我在本地机器上的测试部署不起作用.Program Files 指南受到保护,我不想以管理员身份启动 Ant 或 Eclipse.所以我有了将 webapps 文件夹移动到工作区子文件夹的想法,这样我也可以在 Ant 中使用相对路径.

I am deploying my Java application with Ant. Unfortunately my test deployment on the local machine doesn't work because of Vista. The Program Files directionaries are protected and i don't want to start Ant or Eclipse as an Admin. So i had the idea to move my webapps folder to a workspace subfolder, so i can use relative paths in Ant as well.

解决方案似乎是修改 server.xml 中的 Host 元素.对于 Linux,这不是一个交易:

The solutions seems to be to modify the Host element in the server.xml. With Linux it isn't such a deal:

  <Host name="localhost"  appBase="/path/to/webapps"
        unpackWARs="true" autoDeploy="true"
        xmlValidation="false" xmlNamespaceAware="false">

但是对于 Windows,我不明白.我尝试了我能想到的所有可能的组合,例如:

But with Windows i don't get it right. I tried every possible combinations i could imagine, like:

      C://Users//maerch//Workspaces//Tomcat6.0_webapps
      C:/Users/maerch/Workspaces/Tomcat6.0_webapps
      C:\Users\maerch\Workspaces\Tomcat6.0_webapps
      C:\\Users\\maerch\\Workspaces\\Tomcat6.0_webapps
      C://Users//maerch//Workspaces//Tomcat6.0_webapps\\
      C:/Users/maerch/Workspaces/Tomcat6.0_webapps/
      C:\Users\maerch\Workspaces\Tomcat6.0_webapps\
      C:\\Users\\maerch\\Workspaces\\Tomcat6.0_webapps\\

路径也是正确的,但是不行.日志文件中也没有错误消息,浏览器也不显示 404 消息或其他任何内容.只是一个没有标题的白页等等.有人可以帮忙吗?

The path is also correct, but it doesn't work. There are also no error messages in the log files neither the browser shows a 404 message or anything else. Just a white page without title and so on. Can anyone help?

推荐答案

我在 Vista 中遇到了非常相同的安全问题,我通过为Program Files\Apache Software"上的Users"组提供完全控制"访问级别来解决该问题Foundation\Tomcat XYZ"文件夹.

I have very the same security issue with Vista and I resolve it by providing "Full control" access level for "Users" group on "Program Files\Apache Software Foundation\Tomcat XYZ" folder.

它为我解决了 tomcat 的部署问题以及启动 tomcat 作为服务的问题.当然,您可以更严格地分配权限(每个部署用户组或每个用户).IMO 比重新配置 tomcat 更快捷.

It resolved deployment issues with tomcat for me as well as question on starting tomcat as a service. Of course you can assign permissions more strictly (per deployment user group or per user). IMO it's more quicker way then reconfigure the tomcat.

关于您最初的问题如何在 Windows 下更改 ${catalina.home} 之外的路径:

这与您必须在 *nix 上完成它非常相似:

It's very the same as you have to accomplish it on *nix:

  <Host name="localhost"  appBase="/c:/webapps2"
        unpackWARs="true" autoDeploy="true"
        xmlValidation="false" xmlNamespaceAware="false">

appBase 中提到的文件夹中是否有 ROOT 文件夹?该方法在Tomcat 6.0下测试

Did you have ROOT folder in you folder mentioned in appBase? The approach is tested under Tomcat 6.0

这篇关于Windows 下的 Apache Tomcat:更改 webapps 默认目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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