title: Redirect apache to tomcat
body: <p>I am trying to redirect domain.com to tomcat7, I tried a lot of configurations and doesnt seem to work...</p>
  
  <p>This is my /etc/tomcat7/server.xml config</p>
  
  <pre><code>&lt;Connector port="8080" protocol="HTTP/1.1"
             connectionTimeout="20000"
             URIEncoding="UTF-8"
             redirectPort="8443"
              proxyName="domain.com"
              proxyPort="80"
              /&gt;
  </code></pre>
  
  <p>And this is my /etc/apache2/httpd.conf</p>
  
  <pre><code>LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
  AddModule mod_proxy.c
  
  ProxyPass / http://domain.com:8080/
  ProxyPassReverse / http://domain.com:8080/
  
  &lt;Location "/"&gt;
  Order allow,deny
  Allow from all
  &lt;/Location&gt;
  </code></pre>
  
  <p>When i go to domain.com i get this default apache message:</p>
  
  <pre><code>It works!
  This is the default web page for this server.
  The web server software is running but no content has been added, yet.
  </code></pre>
  
  <p>When i go to domain.com:8080 i get the tomcat message:</p>
  
  <pre><code>It works !
  If you're seeing this page via a web browser, it means you've setup Tomcat successfully.     Congratulations!
  This is the default Tomcat home page. It can be found on the local filesystem at:     /var/lib/tomcat7/webapps/ROOT/index.html
  </code></pre>
  
  <p>I loaded few .WAR with tomcat assistant one is called App1.<br>
  If i go to domain.com/App1 i get:   </p>
  
  <pre><code>The requested URL /App1/ was not found on this server.
  </code></pre>
  
  <p>But if i use domain.com:8080/App1 the app works properly and shows a for loop for example. </p>
  
  <p>UPDATE: tried /etc/apache2/ports.conf with this config:</p>
  
  <pre><code>Listen 80
  ServerName domain.com
  DocumentRoot /var/www/domain.com/public_html
  NameVirtualHost IP
  </code></pre>
  
  <p>UPDATE2: i just wiped out my debian and i just used /etc/apache2/httpd.conf to set this: (only with this file I achieved same result as above, still must use domain.com:8080/appname to run an app...)</p>
  
  <pre><code>&lt;VirtualHost *:8080&gt;
  ProxyRequests off
  ProxyPreserveHost on
  ServerName domain.com
  ServerAlias *.domain.com
  ProxyPass / http://localhost:8080/
  ProxyPassReverse / http://localhost:8080/
  &lt;/VirtualHost&gt; 
  </code></pre>
  
  <p>How can I do it to redirect straight to tomcat default message instead of apaches ?<br>
  And how to get rid of that :8080 and make apps work on domain.com/appname</p>