title: Tomcat port 8080 to 80
body: <p>I installed Apache2 and Tomcat7 on Ubuntu14</p>
  
  <pre><code>http://mysite.it/                    -&gt; Apache OK
  http://mysite.it/phpmyadmin          -&gt; Apache OK, showing phpmyadmin
  http://mysite.it:8080/myApp/         -&gt; Tomcat OK, showing my Spring App
  </code></pre>
  
  <p>The 8080 port is closed in the Client intranet, and <strong>he would like to use <a href="http://mysite.it/myApp/" rel="nofollow">http://mysite.it/myApp/</a></strong>.
  I need to setup the proxy/reverse proxy in Apache2</p>
  
  <p>Here there is what I did:</p>
  
  <pre><code>aptitude    update
  aptitude -y upgrade
  aptitude install -y build-essential
  aptitude install -y libapache2-mod-proxy-html libxml2-dev    
  a2enmod proxy
  a2enmod proxy_http
  a2enmod proxy_ajp
  a2enmod rewrite
  a2enmod deflate
  a2enmod headers
  a2enmod proxy_balancer
  a2enmod proxy_connect
  a2enmod proxy_html
  a2enmod xml2enc
  </code></pre>
  
  <p>Now I should modify /etc/apache2/sites-enabled/000-default.conf</p>
  
  <p>The current (default) version is</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
          ServerAdmin webmaster@localhost
          DocumentRoot /var/www/html
  
          ErrorLog ${APACHE_LOG_DIR}/error.log
          CustomLog ${APACHE_LOG_DIR}/access.log combined
  
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <hr>
  
  <p>I tried to add also this snippet, but no luck</p>
  
  <pre><code>&lt;VirtualHost *:*&gt;
      ProxyPreserveHost On
  
      ProxyPass /myApp/ http://mysite.it:8080/
      ProxyPassReverse /myApp/ http://mysite.it:8080/
  
      ServerName mysite.it
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>Can anyone help me?
  Riccardo</p>
  
  <p>***** SOLUTION ******
  Just one virtualHost:</p>
  
  <pre><code>&lt;VirtualHost *:*&gt;
          ServerAdmin webmaster@localhost
          DocumentRoot /var/www/html
  
          ErrorLog ${APACHE_LOG_DIR}/error.log
          CustomLog ${APACHE_LOG_DIR}/access.log combined
  
      ProxyPreserveHost On
  
      ProxyPass /myApp/ http://mysite.it:8080/myApp/
      ProxyPassReverse /myApp/ http://mysite.it:8080/myApp/
  
      ServerName mysite.it
  
  &lt;/VirtualHost&gt;
  </code></pre>