1,105,581 Community Members

Tomcat - virtual hosting / subdomains

Member Avatar
peter_budo
Code tags enforcer
7,935 posts since Dec 2004
Reputation Points: 2,502 [?]
Q&As Helped to Solve: 1,028 [?]
Skill Endorsements: 66 [?]
Moderator
Featured
 
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???

Member Avatar
peter_budo
Code tags enforcer
7,935 posts since Dec 2004
Reputation Points: 2,502 [?]
Q&As Helped to Solve: 1,028 [?]
Skill Endorsements: 66 [?]
Moderator
Featured
 
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
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: