文档库/home/ec2-user/myproject/web不存在或不是可读目录 [英] Document base /home/ec2-user/myproject/web does not exist or is not a readable directory

查看:69
本文介绍了文档库/home/ec2-user/myproject/web不存在或不是可读目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Apache Tomcat 7将项目部署到AWS.我像这样

I am deploying my project to AWS with Apache Tomcat 7. I added the ROOT.xml into Catalina/localhost/ like this

<Context
 path="/"
 docBase="/home/ec2-user/myproject/web"
 workDir="/home/ec2-user/myproject/work"
 crossContext="true">
</Context>

启动Tomcat给了我一个著名的Tomcat例外,但是遗憾的是,我无法解决它

Starting Tomcat gives me the famous exception of Tomcat, but sadly, I cannot resolve it

java.lang.IllegalArgumentException: Document base /home/ec2-user/myproject/web does not exist or is not a readable directory
        at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:136)
        at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:5247)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5436)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:679)
        at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1966)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:473)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:622)
        at java.lang.Thread.run(Thread.java:748)

我尝试过的事情:

  • sudo chown -R tomcat:tomcat web&&sudo chmod 775 -R web (不工作)
  • sudo ln -s web/etc/tomcat/web (无效)
  • sudo cp -rf web/etc/tomcat/web (实际上,如果我将 web 文件夹位于/home/ec2-user 之外的任何位置,它将开始工作)
  • sudo chown -R tomcat:tomcat web && sudo chmod 775 -R web (Does not work)
  • sudo ln -s web /etc/tomcat/web (Does not work)
  • sudo cp -rf web /etc/tomcat/web (Work, actually, if I move the web folder anywhere outside of /home/ec2-user, it starts to work)

如何使用 ec2-user 下的 web 文件夹进行此项工作?

How can I make this work with the web folder under the ec2-user?

推荐答案

问题已解决.从

TOMCAT_USER ="tomcat"

TOMCAT_USER ="root"

这不是最好的方法,但是我现在可以继续工作

Not the best way, but I can continue my work now

这篇关于文档库/home/ec2-user/myproject/web不存在或不是可读目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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