title: How to set the home execution dir of tomcat application server?
body: <p><code>tomcat8</code> can be installed on <code>ubuntu</code> using either <code>apt-get install tomcat8</code>, or downloading the <code>tar.gz</code> archive and extract it manually.</p>
  
  <p>Problem: the root execution path seems to differ between the installed and the extracted one. I'd like to know how the root path is set for the installed one?</p>
  
  <p><code>catalina.out</code> shows:</p>
  
  <ul>
  <li><p>apt-get installed tomcat:
  <code>... PID 1234 (started by tomcat8 in /var/lib/tomcat8)</code></p></li>
  <li><p>simple extracted tar.gz tomcat archive installation:
  <code>... PID 1234 (started by tomcat8 in /)</code></p></li>
  </ul>
  
  <p>Question: why does the "manually" extracted tomcat have a different home directory <code>/</code> than the apt-get installed one <code>/var/lib/tomcat8</code>?
  Where is this path configured?</p>
  
  <p>Sidenote: it clearing doesn't come from cataline-paths: both tomcats show the correct environment variables:</p>
  
  <p>This is there apt-get installes the home dir by default:</p>
  
  <pre><code>CATALINA_BASE: /usr/share/tomcat8
  CATALINA_HOME: /usr/share/tomcat8
  </code></pre>
  
  <p>extracted:</p>
  
  <pre><code>CATALINA_BASE: /opt/tomcat
  CATALINA_HOME: /opt/tomcat
  </code></pre>