title: Tomcat 7 and Apache2 with mod_jk on Ubuntu 12.04
body: <p>I tried to install Tomcat 7 and Apache2 with mod_jk on Ubuntu 12.04,
  after installing tomcat and test that works fine:</p>
  
  <p><a href="http://139.162.221.XXX:8080/tomcat-demo/helloworld/" rel="nofollow">http://139.162.221.XXX:8080/tomcat-demo/helloworld/</a></p>
  
  <p>I installed and configured mod_jk :</p>
  
  <pre><code>sudo apt-get install libapache2-mod-jk
  </code></pre>
  
  <p>uncomment the following line <strong><code>&lt;Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /&gt;</code></strong> 
  in the file etc/tomcat7/server.xml</p>
  
  <p>add this:</p>
  
  <pre><code># Define 1 real worker using ajp13 
  worker.list=worker1 
  # Set properties for worker (ajp13) 
  worker.worker1.type=ajp13 
  worker.worker1.host=localhost
  worker.worker1.port=8009
  </code></pre>
  
  <p>to /etc/apache2/workers.properties</p>
  
  <p>change the JkWorkersFile property to /etc/apache2/workers.properties in the file /etc/apache2/mods-available/jk.conf</p>
  
  <p>edit the file: /etc/apache2/sites-enabled/000-default</p>
  
  <p>to add</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
  .......................................
  .......................................
  JkMount /tomcat-demo/* worker1
  JkMount /tomcat-demo worker1
  &lt;/VirtualHost *:80&gt;
  </code></pre>
  
  <p>restart the servers:</p>
  
  <pre><code>sudo /etc/init.d/tomcat7 restart
  sudo /etc/init.d/apache2 restart
  </code></pre>
  
  <p>but accessing to <a href="http://139.162.221.XXX/tomcat-demo/helloworld/" rel="nofollow">http://139.162.221.XXX/tomcat-demo/helloworld/</a></p>
  
  <p>I got this error:</p>
  
  <pre><code>Not Found
  
  The requested URL /tomcat-demo/helloworld/ was not found on this server.
  
  Apache/2.4.7 (Ubuntu) Server at 139.162.221.107 Port 80
  </code></pre>
  
  <p>and I have also this error restart Apache:</p>
  
  <pre><code> * Restarting web server apache2                                                                                                                                 AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using ::1. Set the 'ServerName' directive globally to suppress this message
  </code></pre>