> From: mast [mailto:[EMAIL PROTECTED] > Subject: Re: problem with getcontext and context.xml > > <Host name="vhost1.mydomain.com" debug="0" > appBase="/usr/local/tomcat/webapps/myaccount1" > unpackWARs="true" autoDeploy="true"> > <Context path="" docBase="" debug="1" reloadable="true" /> > </Host> > <Host name="vhost2.mydomain.com" debug="0" > appBase="/usr/local/tomcat/webapps/myaccount2" > unpackWARs="true" autoDeploy="true"> > <Context path="" docBase="" debug="1" reloadable="true" /> > </Host>
But since the <Context> is in server.xml, you can't change anything without restarting Tomcat. This is why doing so is strongly discouraged. Even the above is not correct, since appBase is pointing to a specific webapp, rather than the default location for all webapps for the <Host>. When you violate the intent of the configuration settings, you're at risk of your settings failing miserably at any time. > now you told me to have multiple appbase ? so it s not > the same things > as : appBase="/usr/local/tomcat/webapps/myaccount1" ? and appbase > appBase="/usr/local/tomcat/webapps/myaccount2" for the two context ? > > and to have a hierarchy like this : > /usr/local/tomcat/webapps/myaccount1/ROOT/ (where to put my website?) > /usr/local/tomcat/webapps/myaccount2/ROOT/ ? You could do that, but it's an extra directory layer that you don't really need. I'd suggest this instead: appBase="/usr/local/tomcat/webapps1" appBase="/usr/local/tomcat/webapps2" and put your default app for each host in: /usr/local/tomcat/webapps1/ROOT /usr/local/tomcat/webapps2/ROOT where one <Host>'s appBase points to webapps1, and the other to webapps2. Note that the names "myaccount1" and "myaccount2" serve no purpose and have been removed. > it seem much more complicated than to have the context in the > server.xml file no ? No, because it makes the app deployment independent of the Tomcat configuration. > i would prefer in the META-INF for each user to manage it s > own context.xml Agreed, that is the more desirable setup. > it s there : <Engine name="Catalina" > defaultHost="default.mydomain.com"> > no ? No; you're missing the <Host name="default.mydomain.com" ...> entry in your server.xml. Read the doc: "Exactly one of the Hosts associated with each Engine MUST have a name matching the defaultHost attribute of that Engine." http://tomcat.apache.org/tomcat-5.5-doc/config/host.html > Right now my hierarchy is like this : > /usr/local/tomcat/webapps/myaccount1/META-INF/context.xml > usr/local/tomcat/webapps/myaccount1/WEB-INF/web.xml > /usr/local/tomcat/webapps/myaccount2/META-INF/context.xml > usr/local/tomcat/webapps/myaccount2/WEB-INF/web.xml Again, you should separate the webapps of the two hosts, and use ROOT for the default app for each: /usr/local/tomcat/webapps1/ROOT/META-INF/context.xml /usr/local/tomcat/webapps1/ROOT/WEB-INF/web.xml /usr/local/tomcat/webapps2/ROOT/META-INF/context.xml /usr/local/tomcat/webapps2/ROOT/WEB-INF/web.xml The appBase attributes for the two <Host> elements should point to "/usr/local/tomcat/webapps1" and "/usr/local/tomcat/webapps2", respectively. - 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]