title: Apache/Tomcat/Railo: Setting up two sites with same domain but two different ports
body: <p>I have successfully setup Railo with Tomcat and Apache for a website on port 80.  I'm however struggling to set another up that uses the same domain but a port other than 80.  </p>
  
  <p>I have the second site setup on port 9080 and with a SSL certificate and basic authentication.  I can access it and get the SSL certificate and authentication prompt but once I get through that, Railo is outputting the default page (located at /opt/railo/tomcat/webapps/ROOT/index.cfm).</p>
  
  <p>It's as if Tomcat is not getting from Apache the servername for the second site so Railo knows what docbase to use.  Is it because I'm trying to use the same domain?  Do I need to specify port 9080 somewhere in the Tomcat configuration?</p>
  
  <p>I have pasted my configuration below.  Any help is much appreciated.</p>
  
  <p><strong>Apache:</strong></p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
    ServerName sitename
    ServerAlias domainname
    DirectoryIndex index.cfm index.html index.htm
  
    DocumentRoot "/web/sitename"
    &lt;Directory "/web/sitename"&gt;
      allow from all
      Options +Indexes
    &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
  
  Listen 9080
  &lt;VirtualHost *:9080&gt;
    ServerName sitename2
    ServerAlias domainname
    DirectoryIndex index.cfm index.html index.htm
    SSLEngine on
    SSLCertificateFile    /web/ssl/server.crt
    SSLCertificateKeyFile /web/ssl/server.key
  
    DocumentRoot "/web/sitename2
    &lt;Directory "/web/sitename2"&gt;
      allow from all
      Options -Indexes
      AuthName .. basic auth settings ..
    &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p><strong>Tomcat (server.xml):</strong></p>
  
  <pre><code>&lt;Host name="sitename" appBase="webapps"&gt;
      &lt;Context path="" docBase="/web/sitename" /&gt;
  &lt;/Host&gt;
  
  &lt;Host name="sitename2" appBase="webapps"&gt;
      &lt;Context path="" docBase="/web/sitename2" /&gt;
  &lt;/Host&gt;
  </code></pre>