Chapter 5: Basic Tomcat Confi guration A Final
Chapter 5: Basic Tomcat Confi guration A Final Word on Differentiating Between Configuration and Management Inexperienced Tomcat administrators often confuse the Web-based configurator ( admin ) application with the Web-based manager (the manager Web application, covered in more detail in Chapter 8 ) application. At first glance, they appear to offer similar capabilities. In reality, however, they are completely separate Web applications that offer a mutually exclusive set of administrative capabilities. One easy way to distinguish between the two is to realize that the Web-based configurator is used primarily to modify static configuration files that will be read and used by Tomcat before server startup, and that the manager application is used to manage Tomcat operations after server startup. In other words, adminis used for configuration, and manageris used during operations. Tomcat 6 Web-Based GUI Configurator Tomcat 5.5 and earlier versions had a Web-based administration tool called the admin Web application. This admin application enabled management of the Tomcat server itself, including the capability to add, delete, or modify Connectors, Hosts, and Context; manage Resourcessuch as DataSourcesand Environment parameters; and manage users and roles. In short, it provided a Web-based GUI for tasks that otherwise would require editing Tomcat s configuration files ( server.xml, tomcat-users.xml, and so on) and restarting the Tomcat server. Unfortunately, at the time of this writing, this admin tool has not been ported to Tomcat 6. Even if it does get ported, it is disabled by default for security reasons and should never be enabled on a production Web site. Hence, knowledge of Tomcat s server.xml file and the ability to configure it manually is essential for a Tomcat administrator. This section provides an overview of how to configure and start the admin tool. Check for online updates of this blog for coverage of future releases of Tomcat 6 that may include the admin tool. Figure 5-4 shows a typical screen from this tool. In this case, an HTTP Connector component source is being configured. Manual editing of an XML configuration file is always supported by Tomcat, and you may wish to administer your server purely through this method. For those more comfortable with a GUI, the Web- based GUI provided by the admin tool provides an alternative. A major advantage of a Web-based GUI configuration is the capability to perform remote, off-site administration. Of course, for some, this may be viewed as a potential vulnerability. With the admin tool, administrators can reconfigure and maintain server instances wherever a Web browser connected to the Internet is available. Even though the configuration is performed graphically, the XML configuration files are still being modified. These files are kept in the $CATALINA_HOME/conf directory of the Tomcat 6 distribution (or, if you have configured multiple Tomcat 6 instances, the corresponding $CATALINA_BASE/confdirectory). Figure 5-5 illustrates how Web-based Tomcat configuration can be performed, and the behind-the-scenes work that takes place. In Figure 5-5 , the user changes the value of a certain attribute of a Tomcat component via the Web-based GUI. The admin Web application then makes the corresponding change in the configuration XML file.
For high quality java hosting services please check tomcat web hosting website.