Re: Multiple Domains on one Tomcat Server now MySQL not working

2009-10-13 Thread Paul van Hoven

Hi Chuck,

thanks for this detailed answer. I'm running tomcat 6 on an ubuntu 
server. I read the official documentation and modified the configuration 
of my tomcat.
The complete current server.xml (without comments and after my latest 
modification) looks like this:


server.xml:

Server port=8005 shutdown=SHUTDOWN


 Listener className=org.apache.catalina.core.AprLifecycleListener 
SSLEngine=on /

 Listener className=org.apache.catalina.core.JasperListener /
 Listener 
className=org.apache.catalina.mbeans.ServerLifecycleListener /
 Listener 
className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener /


 GlobalNamingResources
   Resource name=UserDatabase auth=Container
 type=org.apache.catalina.UserDatabase
 description=User database that can be updated and saved
 factory=org.apache.catalina.users.MemoryUserDatabaseFactory
 pathname=conf/tomcat-users.xml /
 /GlobalNamingResources

 Service name=Catalina

   Connector port=8080 protocol=HTTP/1.1
  connectionTimeout=2
  redirectPort=8443 /

   Connector port=8009 protocol=AJP/1.3 redirectPort=8443 /

   Engine name=Catalina defaultHost=localhost
 Realm className=org.apache.catalina.realm.UserDatabaseRealm
resourceName=UserDatabase/

 Host name=localhost  appBase=webapps
   unpackWARs=true autoDeploy=true
   xmlValidation=false xmlNamespaceAware=false
 /Host

 Host name=localhost.localdomain
   debug=0
   appBase=webapps2
   unpackWARs=true
   autoDeploy=true
   xmlValidation=false
   xmlNamespaceAware=false
   Aliaswww.clubpirat.de/Alias
 /Host
   /Engine
 /Service
/Server


I checked that in /etc/hosts the two domains localhost and 
localhost.localdomain are assigned to 127.0.0.1.


Now, i have the following directory structure:
CATALINA_HOME/webapps
CATALINA_HOME/webapps2
CATALINA_HOME/conf/Catalina/localhost
CATALINA_HOME/conf/Catalina/localhost.localdomain
CATALINA_HOME/webapps2/ROOT/META-INF

In CATALINA_HOME/conf/Catalina/localhost.localdomain i got the 
following files:

ROOT.xml  log4j_errors.log  manager.xml

And the latter ROOT.xml looks like this:
?xml version='1.0' encoding='utf-8'?
Context displayName=localhost.localdomain
workDir=work/Catalina/clubpirat.de/_
/Context

I also copied my war file into the CATALINA_HOME/webapps2 directory and 
tomcat has deploied the file.


Okay, i when enter the url www.clubpirat.de but i get an 404 error. The 
other url works fine, no problems.



Caldarale, Charles R schrieb:

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.

  

Aliaswww.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 

Re: Multiple Domains on one Tomcat Server now MySQL not working

2009-10-13 Thread Hassan Schroeder
On Mon, Oct 12, 2009 at 11:40 PM, Paul van Hoven
paul.van.ho...@googlemail.com wrote:

     Host name=localhost.localdomain
      ...
   Aliaswww.clubpirat.de/Alias

 I checked that in /etc/hosts the two domains localhost and
 localhost.localdomain are assigned to 127.0.0.1.

 Okay, i when enter the url www.clubpirat.de but i get an 404 error.

And does www.clubpirat.de resolve to your local computer? Either
through an entry in /etc/hosts or DNS?

-- 
Hassan Schroeder  hassan.schroe...@gmail.com
twitter: @hassan

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



Re: Multiple Domains on one Tomcat Server now MySQL not working

2009-10-13 Thread Paul van Hoven

Hi Hassan,

yeah, acutually that was the problem, I just discovered it an instant 
before you answered me :). I made the appropriate changes and now it is 
working fine. Thanks for your answer anyway.


Tom

Hassan Schroeder schrieb:

On Mon, Oct 12, 2009 at 11:40 PM, Paul van Hoven
paul.van.ho...@googlemail.com wrote:

  

Host name=localhost.localdomain
 ...
  Aliaswww.clubpirat.de/Alias



  

I checked that in /etc/hosts the two domains localhost and
localhost.localdomain are assigned to 127.0.0.1.



  

Okay, i when enter the url www.clubpirat.de but i get an 404 error.



And does www.clubpirat.de resolve to your local computer? Either
through an entry in /etc/hosts or DNS?

  



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



RE: Multiple Domains on one Tomcat Server now MySQL not working

2009-10-12 Thread Caldarale, Charles R
 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.

 Aliaswww.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



Re: multiple domains

2008-03-05 Thread quikpak

dont send me tomcat hereafter!!
- Original Message - 
From: Angelo Chen [EMAIL PROTECTED]

To: users@tomcat.apache.org
Sent: Thursday, March 06, 2008 8:29 AM
Subject: multiple domains




Hi guys,

I have this server that has two domains pointing at it, the tomcat server 
5

is running there, I have two wep applications for the two domains, so i
like:

www.domain1.com will call the app1
www.domain2.com will call the app2

how to configure tomcat to work like this? thanks

Angelo
--
View this message in context: 
http://www.nabble.com/multiple-domains-tp15865530p15865530.html

Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: multiple domains

2008-03-05 Thread Caldarale, Charles R
 From: Angelo Chen [mailto:[EMAIL PROTECTED] 
 Subject: multiple domains
 
 www.domain1.com will call the app1
 www.domain2.com will call the app2

In conf/server.xml, configure two Host elements, one for each domain.
Create a separate appBase directory for each Host, and configure the
appBase in each appropriately.  Place app1 under domain1's appBase as
ROOT, app2 under domain2's appBase as ROOT.  You're done.

Doc references:
http://tomcat.apache.org/tomcat-5.5-doc/config/host.html
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

 - 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 start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]