Chapter 5: Basic Tomcat Confi guration The Host Component After the global UserDatabase Realm component configuration, the next configured component is a Host component. A Host component is a container; it can contain other nested components. The Host component represents a virtual host handled by a Tomcat 6 server instance. A single Tomcat 6 server can contain many virtual hosts. Each virtual host can be considered as a distinct request processing destination. A virtual host is configured as a element within the server.xmlfile. Each element defined within the enclosing element represents another virtual host that is handled by this Engine. In our case, the Host definition is as follows: This defines a virtual host named localhostmatching the defaultHostspecified in the outer container. The applications to be deployed for this virtual host are located under the $CATALINA_ HOME/webapps directory (all the examples from the Tomcat 6 distribution are installed there). In addition, the unpackWARs attribute specifies that if Tomcat 6 finds any WAR files in the appBasedirectory, they will be expanded before the Web application is executed. If you set unpackWARsto false , Tomcat executes the Web applications in place, without unarchiving them saving space but sacrificing performance. The autoDeployattribute is set to true, meaning that Tomcat actively scans for the addition of new Web applications or changes in existing ones, and then automatically deploys, or redeploys, them. See the description of the autoDeploy attribute in the next section for more details. Chapter 15 discusses the techniques used to support virtual hosting. For now, however, Figure 5-2 illustrates the basic concept of virtual hosting. Server Service Engine WebApp1 Restaurant Operations WebApp2 Supply Ordering WebApp1 Car Showroom WebApp2 Leasing WebApp1 Author BBS WebApp2 Book Store Virtual Host 3 (betterbookends.com) Virtual Host 2 (buycarsnow.com) Virtual Host 1 (foodnuts.com) Figure 5-2: Virtual hosting in Tomcat 6
If you looking for unlimited one inclusive web hosting plan please check cheap web hosting website.
This entry was posted
on Sunday, February 15th, 2009 at 3:38 pm and is filed under tomcat.
You can follow any responses to this entry through the RSS 2.0 feed.
Responses are currently closed, but you can trackback from your own site.