title: Document base /home/ec2-user/myproject/web does not exist or is not a readable directory
body: <p>I am deploying my project to AWS with Apache Tomcat 7. I added the <code>ROOT.xml</code> into <code>Catalina/localhost/</code> like this </p>
  
  <pre><code>&lt;Context
   path="/"
   docBase="/home/ec2-user/myproject/web"
   workDir="/home/ec2-user/myproject/work"
   crossContext="true"&gt;
  &lt;/Context&gt;
  </code></pre>
  
  <p>Starting Tomcat gives me the famous exception of Tomcat, but sadly, I cannot resolve it</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>Things I tried:</p>
  
  <ul>
  <li><code>sudo chown -R tomcat:tomcat web &amp;&amp; sudo chmod 775 -R web</code> (Does not
  work) </li>
  <li><code>sudo ln -s web /etc/tomcat/web</code> (Does not work)</li>
  <li><code>sudo cp -rf web /etc/tomcat/web</code> (Work, actually, if I move the
  <code>web</code> folder anywhere outside of <code>/home/ec2-user</code>, it starts to work)</li>
  </ul>
  
  <p>How can I make this work with the <code>web</code> folder under the <code>ec2-user</code>?</p>