Tomcat - virtual hosting / subdomains


I running my little blog on Tomcat 6 server. My hosting company allows me to set up multiple sub domains. I was trying to do for last few hours, but no luck. Having started with

<Engine name="Catalina" defaultHost="">

      <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>

      <Host name="" appBase="/home/user/public_html" unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
         <Context path="" reloadable="true" docBase="/home/user/public_html" />
         <Context path="/manager" docBase="/usr/local/tomcat/users/user/tomcat/webapps/manager"
                  privileged="true" antiResourceLocking="false" antiJARLocking="false" reloadable="true" />


I added new host to engine as

<Host name="" appBase="/home/user/code_public_html" unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
         <Context path="" reloadable="true" docBase="/home/user/code_public_html" />

I tried to also follow Virtual Hosting and Tomcat 1 and 2 (2nd one is currently in place).

I created basic web app structure of WEB-INF (web.xml, classes, lib), index.html and index.jsp. However I'm getting 403

You don't have permission to access / on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.



As it happens I cannot create new folder in root to hold subdomain, hosting restriction. I must create new folder inside public_html and then it will work.

Problem solved

Question Self-Answered as of 5 Years Ago
Isn't it about time forums rewarded their contributors?

Earn rewards points for helping others. Gain kudos. Cash out. Get better answers yourself.

It's as simple as contributing editorial or replying to discussions labeled or OP Kudos

This question has already been solved: Start a new discussion instead
Start New Discussion
View similar articles that have also been tagged: