如何使tomcat炸开战争文件 [英] how to make tomcat explode the war files

查看:62
本文介绍了如何使tomcat炸开战争文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

参考 tomcat和提取的文件 我已将server.xml配置为auto deploy : true. 我的war文件名是ROOT.war,因为我不想在site.com之后添加/subdir.

With reference to tomcat and extracted files I have configured server.xml to auto deploy : true. My war file name is ROOT.war as I do not want /subdir after the site.com.

但是我没有在/webappts/ROOT或任何地方看到.css .js .java或.class文件. (我将它们放在ROOT.war中,并且通过反映它们,网站运行正常)

But I dont see the .css .js .java or .class files in /webappts/ROOT or any where. (I have them in the ROOT.war and the site is running fine with reflecting them)

我只能在

/var/cache/tomcat7/Catalina/localhost/_/org/apache/jsp/

/var/cache/tomcat7/Catalina/localhost/_/WEB-INF/classes/

如何配置tomcat爆炸.war文件?

how to configure tomcat to explode the .war file?

更新我

我有Host name="localhost" appBase="/home/ubuntu/www" unpackWARs="true" autoDeploy="true" 而且我仍然没有看到开箱.我的ROOT.war位于/home/ubuntu/www

I have Host name="localhost" appBase="/home/ubuntu/www" unpackWARs="true" autoDeploy="true" and I still dont see unpacking . My ROOT.war is in /home/ubuntu/www

更新II

我看到的一个问题是:

Feb 27, 2013 6:29:02 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /home/ubuntu/www/ROOT.war
Feb 27, 2013 6:29:02 PM org.apache.catalina.startup.ContextConfig init
SEVERE: Exception fixing docBase for context []
java.io.IOException: Unable to create the directory [/home/ubuntu/www/ROOT]
        at org.apache.catalina.startup.ExpandWar.expand(ExpandWar.java:100)
        at org.apache.catalina.startup.ContextConfig.fixDocBase(ContextConfig.java:720)
        at org.apache.catalina.startup.ContextConfig.init(ContextConfig.java:843)

如果我手动使用chmod 777在/home/ubuntu/www/中进行根设置.它会给出 404 错误(不存在)

If i manually make ROOT in /home/ubuntu/www/ with chmod 777 . it gives 404 error (doesnt exists)

推荐答案

您的/home/ubuntu/www文件夹必须可由Tomcat进程写入.所有者和组应为tomcat6/tomcat7(取决于您使用的TC).像这样:

Your /home/ubuntu/www folder needs to be writable by Tomcat process. The owner and group should be tomcat6/tomcat7 (depending on which TC you use). Like this:

drwxrwxr-x  4 tomcat7 tomcat7 4096 Feb 27 14:08 webapps

您不应该将chmod 777更改为chmod文件夹,因为正确地推测出这是安全隐患. "chown tomcat7:tomcat7"应该可以正常工作.

You shouldnt chmod 777 the folder, this is a security risk as you correctly surmised. 'chown tomcat7:tomcat7' should work.

这篇关于如何使tomcat炸开战争文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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