Chapter 5: Basic Tomcat Confi guration // Precompiled
Saturday, February 28th, 2009Chapter 5: Basic Tomcat Confi guration // Precompiled JSPs need access to this package. permission java.lang.RuntimePermission accessClassInPackage.org.apache.jasper.runtime ; permission java.lang.RuntimePermission accessClassInPackage.org.apache.jasper.runtime.* ;}; These minimal permissions are granted by default to Web applications. A typical secured production configuration will require opening up additional access to the Web applications, such as socket access to a JDBC server or network access to an external authentication system. catalina.properties: Finer-Grained Control over Access Checks Last but not least, the $CATALINA_HOME/conf/catalina.properties file is read during a secured Tomcat 6 server startup, and allows administrators to configure access control at a Java package level. This level of restriction causes a SecurityException to be reported should an errant or malicious Web application attempt to access these Tomcat 6 internal classes directly, or if a new class definition is attempted under these highly privileged packages. The following lines in the catalina.propertiesfile specify the name of the internal packages that should be restricted. Where partial package names are specified, any subpackages are protected as well. package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat., org.apache.jasper.,sun.beans. package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote., org.apache.tomcat.,org.apache.jasper. Other lines in catalina.propertiesinclude path definitions for the common, server, and shared class loaders (see Chapter 9 on Tomcat class loading): common.loader=${catalina.home}/lib,${catalina.home}/lib/*.jar server.loader= shared.loader= The last line of catalina.propertiesenables the use of the String cache. This cache is used internally in the conversion methods ByteChunk.toString()and CharChunk.toString(). tomcat.util.buf.StringCache.byte.enabled=true Bootstrapping Configuration Before concluding this chapter, it is important to reiterate that any Web-based administration tool (such as the admin tool discussed in the last section of this chapter) is itself a Tomcat 6 hosted Web application. This means that Tomcat 6 must be running and operating for you to be able to access it. Tomcat 6 includes a default bootstrap configuration to ensure that these tools can start under most circumstances. However, in the unlikely event that you have made manual modifications and the Tomcat 6 instance will not start up, your only remaining recourse is to edit the XML configuration files via a text editor. This is the primary reason why this chapter has devoted considerable coverage to Tomcat administration from the perspective of manually editing the XML configuration files.
For high quality website hosting services please check java web hosting website.