1.11M Members

Tomcat - virtual hosting / subdomains

 
0
 

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="mydomain.co.uk">

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


      <Host name="mydomain.co.uk" appBase="/home/user/public_html" unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
         <Alias>www.mydomain.co.uk</Alias>
         <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" />
      </Host>

    </Engine>

I added new host to engine as

<Host name="code.mydomain.co.uk" appBase="/home/user/code_public_html" unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
         <Alias>code.mydomain.co.uk</Alias>
         <Context path="" reloadable="true" docBase="/home/user/code_public_html" />
      </Host>

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.

Suggestion???

 
0
 

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 4 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

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