Re: Virtual Host and dynamic webapp reloading
My full host element then: Host name=mydomain.com appBase=webapps/mywebapp unpackWars=true autoDeploy=true Context path= docBase=. debug=0 cookies=false / Context path=/asmalljspapp docBase=../smalljspapp debug=0 / Aliaswww.myvirtualhost.com/Alias Aliassubdomain.myvirtualhost.com/Alias Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster managerClassName=org.apache.catalina.cluster.session.DeltaManager expireSessionsOnShutdown=false useDirtyFlag=true notifyListenersOnReplication=true Membership className=org.apache.catalina.cluster.mcast.McastService mcastAddr=228.0.0.5 mcastPort=45565 mcastFrequency=500 mcastDropTime=3000/ Receiver className=org.apache.catalina.cluster.tcp.ReplicationListener tcpListenAddress=10.78.1.43 tcpListenPort=4002 tcpSelectorTimeout=100 tcpThreadCount=6/ Sender className=org.apache.catalina.cluster.tcp.ReplicationTransmitter replicationMode=pooled ackTimeout=15000 stateTransferTimeout=45 waitForAck=true/ Valve className=org.apache.catalina.cluster.tcp.ReplicationValve filter=.*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.css;.*\.txt;/ ClusterListener className=org.apache.catalina.cluster.session.ClusterSessionListener/ /Cluster /Host Any ideas? Pid wrote: Daniel M Garland wrote: Hello, I have a virtual host configured on my Tomcat 5.5.20 cluster installation. In my server.xml, I have Host name=mydomain.com appBase=webapps/mywebapp unpackWars=true autoDeploy=true What config do you have in your Context(s)? p And yet if I copy in a new war file (I'm using ant's deploy task) I don't see any changes to my webapp. If I look at the individual server's webapp via the manager application, I see the changes; but I don't see any changes by looking at the virtual host address until I restart Tomcat. Why? Thanks in advance. Dan Garland [EMAIL PROTECTED] __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ - 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] __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ - 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: Virtual Host and dynamic webapp reloading
Daniel M Garland wrote: My full host element then: yeah... remove the context defs from server.xml and put them in META-INF/context.xml, which is a dir/file inside your webapp. this method of defining contexts is not encouraged, because you have to restart the server to reload the config, amongst other reasons. the default web app is called ROOT.war, your other one would be asmalljspapp.war. put both files in the appBase dir. when it unpacks, it'll drop the contexts like so: appBase/ROOT/META-INF/context.xml appBase/asmalljspapp/META-INF/context.xml i strongly recommend that you have a read of the Context config stuff in the docs. you'll need to set reloadable=true. http://tomcat.apache.org/tomcat-5.5-doc/config/context.html p Host name=mydomain.com appBase=webapps/mywebapp unpackWars=true autoDeploy=true Context path= docBase=. debug=0 cookies=false / Context path=/asmalljspapp docBase=../smalljspapp debug=0 / Aliaswww.myvirtualhost.com/Alias Aliassubdomain.myvirtualhost.com/Alias Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster managerClassName=org.apache.catalina.cluster.session.DeltaManager expireSessionsOnShutdown=false useDirtyFlag=true notifyListenersOnReplication=true Membership className=org.apache.catalina.cluster.mcast.McastService mcastAddr=228.0.0.5 mcastPort=45565 mcastFrequency=500 mcastDropTime=3000/ Receiver className=org.apache.catalina.cluster.tcp.ReplicationListener tcpListenAddress=10.78.1.43 tcpListenPort=4002 tcpSelectorTimeout=100 tcpThreadCount=6/ Sender className=org.apache.catalina.cluster.tcp.ReplicationTransmitter replicationMode=pooled ackTimeout=15000 stateTransferTimeout=45 waitForAck=true/ Valve className=org.apache.catalina.cluster.tcp.ReplicationValve filter=.*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.css;.*\.txt;/ ClusterListener className=org.apache.catalina.cluster.session.ClusterSessionListener/ /Cluster /Host Any ideas? Pid wrote: Daniel M Garland wrote: Hello, I have a virtual host configured on my Tomcat 5.5.20 cluster installation. In my server.xml, I have Host name=mydomain.com appBase=webapps/mywebapp unpackWars=true autoDeploy=true What config do you have in your Context(s)? p And yet if I copy in a new war file (I'm using ant's deploy task) I don't see any changes to my webapp. If I look at the individual server's webapp via the manager application, I see the changes; but I don't see any changes by looking at the virtual host address until I restart Tomcat. Why? Thanks in advance. Dan Garland [EMAIL PROTECTED] __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ - 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] __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ - 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: Virtual Host and dynamic webapp reloading
From: Daniel M Garland [mailto:[EMAIL PROTECTED] Subject: Re: Virtual Host and dynamic webapp reloading Context path= docBase=. debug=0 cookies=false / One other problem: docBase must point to the same directory as appBase. The result is endless confusion within Tomcat. - 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]
Re: Virtual Host and dynamic webapp reloading
I've gotta say I've had a miserable time with this one. I've tried nearly permutation of configurations in the Tomcat documentation and nothing seems to work; either I get the default host or a white blank screen. What I need is for www.mydomain.com to host mywebapp on the default path and anotherapp on path /anotherapp If I have this setup in server.xml, everything works: ... Host name=mydomain.com appBase=webapps/mywebapp unpackWars=true autoDeploy=true Context path= docBase=. debug=0 cookies=false / Context path=/anotherapp docBase=../anotherapp debug=0 / ... However, to get the dynamic webapp reloading I've been recommended to move my Context elements out of server.xml. As I am running muliple virtual hosts I understand that I cannot use conf/context.xml because this applies to all hosts. So I have tried each of the following, without success: - creating a conf/Catalina/mydomain.com/mywebapp.xml - creating a conf/Catalina/mydomain.com/ROOT.xml - creating a conf/Catalina/mydomain.com/context.xml - creating a conf/Catalina/mydomain.com/context.xml.default - creating a META-INF/context.xml in the web app (although I'd prefer to sort this out within Tomcat anyway) I've also tried several variations on the docBase: ., mywebapp, the absolute path, the absolute path to the .war file... I mean, why wouldn't this work? in conf/server.xml: Host name=mydomain.com appBase=webapps/mywebapp unpackWars=true in conf/Catalina/mydomain.com/mywebapp.xml: Context path= docBase=. debug=0 / Any ideas on how I can achieve the equivalent of my working server.xml with nested Contexts in some other file? Regards Dan Garland Pid wrote: Daniel M Garland wrote: My full host element then: yeah... remove the context defs from server.xml and put them in META-INF/context.xml, which is a dir/file inside your webapp. this method of defining contexts is not encouraged, because you have to restart the server to reload the config, amongst other reasons. the default web app is called ROOT.war, your other one would be asmalljspapp.war. put both files in the appBase dir. when it unpacks, it'll drop the contexts like so: appBase/ROOT/META-INF/context.xml appBase/asmalljspapp/META-INF/context.xml i strongly recommend that you have a read of the Context config stuff in the docs. you'll need to set reloadable=true. http://tomcat.apache.org/tomcat-5.5-doc/config/context.html p Host name=mydomain.com appBase=webapps/mywebapp unpackWars=true autoDeploy=true Context path= docBase=. debug=0 cookies=false / Context path=/asmalljspapp docBase=../smalljspapp debug=0 / Aliaswww.myvirtualhost.com/Alias Aliassubdomain.myvirtualhost.com/Alias Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster managerClassName=org.apache.catalina.cluster.session.DeltaManager expireSessionsOnShutdown=false useDirtyFlag=true notifyListenersOnReplication=true Membership className=org.apache.catalina.cluster.mcast.McastService mcastAddr=228.0.0.5 mcastPort=45565 mcastFrequency=500 mcastDropTime=3000/ Receiver className=org.apache.catalina.cluster.tcp.ReplicationListener tcpListenAddress=10.78.1.43 tcpListenPort=4002 tcpSelectorTimeout=100 tcpThreadCount=6/ Sender className=org.apache.catalina.cluster.tcp.ReplicationTransmitter replicationMode=pooled ackTimeout=15000 stateTransferTimeout=45 waitForAck=true/ Valve className=org.apache.catalina.cluster.tcp.ReplicationValve filter=.*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.css;.*\.txt;/ ClusterListener className=org.apache.catalina.cluster.session.ClusterSessionListener/ /Cluster /Host Any ideas? Pid wrote: Daniel M Garland wrote: Hello, I have a virtual host configured on my Tomcat 5.5.20 cluster installation. In my server.xml, I have Host name=mydomain.com appBase=webapps/mywebapp unpackWars=true autoDeploy=true What config do you have in your Context(s)? p And yet if I copy in a new war file (I'm using ant's deploy task) I don't see any changes to my webapp. If I look at the individual server's webapp via the manager application, I see the changes; but I don't see any changes by looking at the virtual host address until I restart Tomcat. Why? Thanks in advance. Dan Garland [EMAIL PROTECTED] __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ - To start a new topic, e-mail:
Re: Virtual Host and dynamic webapp reloading
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dan, Daniel M Garland wrote: Host name=mydomain.com appBase=webapps/mywebapp unpackWars=true autoDeploy=true Context path= docBase=. debug=0 cookies=false / Context path=/anotherapp docBase=../anotherapp debug=0 / That docBase=. is going to give you nothing but trouble. Why can't you just do this: 1. Start with a clean install of Tomcat. 2. Modify CATALINA_HOME/conf/server.xml to include your clustering configuration. 3. Drop ROOT.war into CATALINA_HOME/webapps 4. Drop anotherapp.was into CATALINA_HOME/webapps 5. Start up Tomcat This should work. You don't need any crazy configuration. Your Context configuration should be in META-INF/context.xml in each of your WAR files. Tell me more about your virtual host configuration. Do you actually need Tomcat to understand your virtual hosts? Or, is it sufficient to have all applications available to all host names? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFG+n5l9CaO5/Lv0PARAo1aAJ9umVYb/ikB/9BMuzTP+DOHSAIF8gCbBLS5 mib6X4Uo/BvMMMP7tL6L30k= =gz0h -END PGP SIGNATURE- - 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: Virtual Host and dynamic webapp reloading
Hi Chris, I have three virtual hosts that I want to have hosting a webapp on the default path. Each host has a few aliases for subdomains etc. So I don't really want to have ROOT.war in CATALINA_HOME/webapps, partly because I want to keep the manager app and partly because I would have a ROOT.war files for each host, so I think you're saying CATALINA_HOME/webapps /myapp1/ROOT /myapp2/ROOT /myapp3/ROOT So I would've thought that I'd have the appBase of each host be myappX/ROOT, but what would the corresponding context.xml be? Does it actually work holding this file in /conf, I'm not sure about having this in the webapp, is it standard to have a META-INF/context.xml or is that a Tomcat thing? Thanks for all the input so far folks Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dan, Daniel M Garland wrote: Host name=mydomain.com appBase=webapps/mywebapp unpackWars=true autoDeploy=true Context path= docBase=. debug=0 cookies=false / Context path=/anotherapp docBase=../anotherapp debug=0 / That docBase=. is going to give you nothing but trouble. Why can't you just do this: 1. Start with a clean install of Tomcat. 2. Modify CATALINA_HOME/conf/server.xml to include your clustering configuration. 3. Drop ROOT.war into CATALINA_HOME/webapps 4. Drop anotherapp.was into CATALINA_HOME/webapps 5. Start up Tomcat This should work. You don't need any crazy configuration. Your Context configuration should be in META-INF/context.xml in each of your WAR files. Tell me more about your virtual host configuration. Do you actually need Tomcat to understand your virtual hosts? Or, is it sufficient to have all applications available to all host names? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFG+n5l9CaO5/Lv0PARAo1aAJ9umVYb/ikB/9BMuzTP+DOHSAIF8gCbBLS5 mib6X4Uo/BvMMMP7tL6L30k= =gz0h -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ - 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: Virtual Host and dynamic webapp reloading
On 9/26/07, Daniel M Garland [EMAIL PROTECTED] wrote: So I would've thought that snip/ Have you read this? http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html -- Hassan Schroeder [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: Virtual Host and dynamic webapp reloading
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dan, Daniel M Garland wrote: I have three virtual hosts that I want to have hosting a webapp on the default path. Different apps, or the same app on each virtual host? Each host has a few aliases for subdomains etc. So I don't really want to have ROOT.war in CATALINA_HOME/webapps, partly because I want to keep the manager app and partly because I would have a ROOT.war files for each host. You can deploy the manager app even when there is a ROOT application deployed. so I think you're saying CATALINA_HOME/webapps /myapp1/ROOT /myapp2/ROOT /myapp3/ROOT Well, I didn't say that, but if I had said something like that, I would have suggested: CATALINA_HOME/webapps (contains nothing) VIRTUAL_HOME/www.domain1.com[/webapps] ROOT myapp1 myapp2 ... VIRTUAL_HOME/www.domain2.com[/webapps] ROOT myapp1 myapp2 ... You will need separate Host elements in your server.xml file. The appBase for each of these should be VIRTUAL_HOST/www.[whatever].com, or whatever you choose to be your directory layout. If you are deploying all the same applications on all virtual hosts, then you can ignore the whole virtual host concept and just use a default host to serve everything regardless of the hostname. So I would've thought that I'd have the appBase of each host be myappX/ROOT No, no no. The appBase tells Tomcat where to look for deployable applications, not the directory where /index.html should be found. This is NOT the same thing as DocumentRoot in Apache httpd. Shave off the ROOT and you've got yourself a decent configuration. If there is a directory called ROOT (or a WAR file called ROOT.war) in the appBase directory, /that/ application will be used as the one that is deployed with no context path (i.e on / instead of /myapp). but what would the corresponding context.xml be? The context.xml file should not contain any path information whatsoever. All you need is JNDI resources, realm configuration and stuff like that. This is a perfectly good context.xml file: Context / You don't need anything else unless your application needs special configuration. If you don't have anything in your context.xml file, you can even leave it out, since Tomcat will give you the default deployment configuration (which is an empty config). Does it actually work holding this file in /conf, I'm not sure about having this in the webapp, is it standard to have a META-INF/context.xml or is that a Tomcat thing? This is a Tomcat thing only. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFG+ol+9CaO5/Lv0PARAkpzAKCLVOu23XOa63lHvEMIvOOSe/DNSACfUa7m U9DbG+9+gn2Q6mXVcI759Pc= =b2Kr -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Virtual Host and dynamic webapp reloading
Hello, I have a virtual host configured on my Tomcat 5.5.20 cluster installation. In my server.xml, I have Host name=mydomain.com appBase=webapps/mywebapp unpackWars=true autoDeploy=true And yet if I copy in a new war file (I'm using ant's deploy task) I don't see any changes to my webapp. If I look at the individual server's webapp via the manager application, I see the changes; but I don't see any changes by looking at the virtual host address until I restart Tomcat. Why? Thanks in advance. Dan Garland [EMAIL PROTECTED] __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ - 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: Virtual Host and dynamic webapp reloading
Daniel M Garland wrote: Hello, I have a virtual host configured on my Tomcat 5.5.20 cluster installation. In my server.xml, I have Host name=mydomain.com appBase=webapps/mywebapp unpackWars=true autoDeploy=true What config do you have in your Context(s)? p And yet if I copy in a new war file (I'm using ant's deploy task) I don't see any changes to my webapp. If I look at the individual server's webapp via the manager application, I see the changes; but I don't see any changes by looking at the virtual host address until I restart Tomcat. Why? Thanks in advance. Dan Garland [EMAIL PROTECTED] __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ - 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]