title: "Virtualhost" for Tomcat8
body: <p>I am used to administering Apache web servers and am getting stuck on something with Tomcat 8. I installed Guacamole on my computer, I copied the .war file to <code>/var/lib/tomcat8/webapps</code> which automatically was unpacked, but I couldn't access it on port <code>:8080</code>. I saw the files in <code>/var/lib/tomcat8/webapps/guacamole</code> so I copied those over to <code>/var/lib/tomcat8/webapps/ROOT</code> which worked. I can now see it on port <code>:8080</code>.</p>
  
  <p>Next step was to troubleshoot why it wasn't working in its own directory, so I setup in the <code>/etc/tomcat8/server.xml</code> this section:</p>
  
  <pre><code>&lt;Service name="Guacamole"&gt;
  &lt;Connector port="8081" protocol="HTTP/1.1"
                     connectionTimeout="20000"
                     URIEncoding="UTF-8" /&gt;
          &lt;Engine name="Catalina" defaultHost="localhost"&gt;
                  &lt;Realm className="org.apache.catalina.realm.LockOutRealm"&gt;
                          &lt;Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase" /&gt;
                  &lt;/Realm&gt;
                  &lt;Host name="localhost"  appBase="webapps/guac" unpackWARs="true" autoDeploy="true"&gt;
                  &lt;Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
                             prefix="guacamole_access_log" suffix=".txt"
                             pattern="%h %l %u %t %v &amp;quot;%r&amp;quot; %s %b" /&gt;
                  &lt;/Host&gt;
          &lt;/Engine&gt;
  &lt;/Service&gt;
  </code></pre>
  
  <p>I have tried a dozen different ways of setting that up with different <code>appBase</code> directories and so on. When I start Tomcat, all seems well in the catalina.out file, but when I check the log file for this service I get:</p>
  
  <pre><code>192.168.1.228 - - [29/Nov/2016:11:48:30 -0700] "GET / HTTP/1.1" 404 -
  192.168.1.228 - - [29/Nov/2016:11:48:41 -0700] "GET /index.html HTTP/1.1" 404 -
  </code></pre>
  
  <p>I tried both <code>http://192.168.1.25:8080/</code> and <code>http://192.168.1.25:8080/index.html</code>, which I can see in the <code>/var/lib/tomcat8/webapps/guacamole</code> directory, but no luck.</p>
  
  <p>I tried to see if I could get more verbose info from Tomcat to see if I could get what it though the path should be to those files, but there doesn't seem to be an option on this page: <a href="https://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/valves/AccessLogValve.html" rel="nofollow noreferrer">https://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/valves/AccessLogValve.html</a> to get this type of output:</p>
  
  <pre><code>192.168.1.228 - - [29/Nov/2016:11:48:30 -0700] "GET /var/lib/tomcat8/webapps/guacamole/ HTTP/1.1" 404 -
  192.168.1.228 - - [29/Nov/2016:11:48:41 -0700] "GET /var/lib/tomcat8/webapps/guacamole/index.html HTTP/1.1" 404 -
  </code></pre>
  
  <p>Any help is appreciated in helping me identify what I have done wrong with my first Java webapp project</p>