> From: Paul van Hoven [mailto:paul.van.ho...@googlemail.com]
> Subject: Multiple Domains on one Tomcat Server now MySQL not working
> 
> I'm not shure if this problem really relates to Tomcat but it happened
> after altering the tomcat configuration.

Care to give us a hint about version of Tomcat you're using?  Configuration is 
different from level to level.

> Therefore i search on the internet how to manage
> multiple domains on Tomcat.

Might be better to read the real documentation first:
http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html
http://tomcat.apache.org/tomcat-5.5-doc/virtual-hosting-howto.html

> I found this resource:
> http://www.westsoftware.net/java/domains-on-tomcat.jsp.

It's unfortunate you found that, since it's chock full of errors.

>      <Host name="localhost"  appBase="webapps"
>             unpackWARs="true" autoDeploy="true"
>             xmlValidation="false" xmlNamespaceAware="false">
>         </Host>
>       <Host name="mydomain.de"
>            debug="0"
>            appBase="webapps/myapp2"

The above is not good; the different appBase directories must be distinct, not 
one under another.

>            unpackWARs="true"
>            autoDeploy="true"
>            xmlValidation="false"
>            xmlNamespaceAware="false">
>     <Logger className="org.apache.catalina.logger.FileLogger"
>            directory="logs"
>            prefix="mydomain.de-log."
>            suffix=".txt" timestamp="true"/>

<Logger> elements have not been used in Tomcat for some years.

>     <Alias>www.mydomain.de</Alias>
>       </Host>
>     </Engine>
>   </Service>
> </Server>
> 
> and i added the follwing ROOT.xml file in the folder
> $CATALINA_HOME/conf/Catalina/mydomain.de

> ROOT.xml:
> <?xml version='1.0' encoding='utf-8'?>
>     <Context displayName="mydomain.de"
>                   docBase=""
>                   path=""
>                   workDir="work/Catalina/mydomain.de/_">
> </Context>

Both the docBase and path attributes have invalid values; luckily, neither one 
is allowed here, and they are hopefully being ignored.

> Actually it works fine, i can now differentiate between the two webapps
> by the domain.

What two webapps?  You have only shown us one <Context> element.

> But while the first webapp has no problems accessing the
> mysql database i do have problems with the second webapp for which i
> added the new configuration.

What's the first webapp?  What <Resource> elements have you defined, and where 
are they?  You might want to post your complete server.xml and all <Context> 
elements.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to