This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Tomcat-6: Per-virtual-host environment stuff? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat-6: Per-virtual-host environment stuff?" Watch "Tomcat-6: Per-virtual-host environment stuff?" New topic
Author

Tomcat-6: Per-virtual-host environment stuff?

Andrei Hager
Greenhorn

Joined: Mar 06, 2007
Posts: 10
I'm trying to make a simple string (path to an important file) available to all webapps on a given virtual-host via server.xml. Here's an example of what does NOT work, but comes close:



The problem is that The "default context" only applies to stuff in the ROOT folder, but not any other webapps. What I really want is to be able to set an <Environment> value (or something equivalent) which is visible by all webapps under the <Host>.

Any suggestions?
Andrei Hager
Greenhorn

Joined: Mar 06, 2007
Posts: 10
Answer: You can do a per-host context by putting XML in:

$CATALINA_HOME/conf/EngineName/HostName/context.xml.default

e.g.

/usr/share/tomcat6/conf/Catalina/www.example.com/context.xml.default

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Tomcat-6: Per-virtual-host environment stuff?
 
Similar Threads
how to configure the a web application directory as the root directory
Disabling http://sitename:8080
Tomcat virtual host and struts
Delare virtual host
Problem while virtual hosting in Tomcat 5.0.28