官术网_书友最值得收藏!

  • Apache Tomcat 7 Essentials
  • Tanuj Khare
  • 420字
  • 2021-08-20 15:35:11

Configuration files and their usage

Apache Tomcat 7 comes with a default setup, which can be directly used for a QA environment. We can customize Tomcat based on the environment specification; components such as Services, Servers, Engine, Connectors, Realm, and Valve can be configured. The Tomcat configuration files are available in the conf folder. Let's discuss the configuration properties and their usage.

Tomcat 7, by default, comes with seven configuration files (usually in XML format), and these files are very useful in order to customize Tomcat, based on the environment needs. We shall install in the production or development environment.

The following screenshot shows the directory structure of the configuration directory for Tomcat 7:

Configuration files and their usage

It's very important from an administrator's point of view, to know about the configuration files and their usage in the Tomcat environment. Let's discuss the configuration properties one-by-one, as follows:

  • catalina.policy: This file describes the security policy permissions for Tomcat 7. It enforces the security policy permissions by JVM on the web application.

Note

When catalina is executed with the -security option, the security policy mentioned in the catalina file is used and the web application security policy also gets executed.

  • catalina.properties: This file contains the shared definition of the server, shared loader, and JARs, which need to be scanned at the time of the server startup.
  • server.xml: This is one of the important configuration files of Tomcat. It holds critical information, such as the IP address, port, virtual host, context path, and so on.
  • tomcat-users.xml: This file is used for authentication, authorization, and role-based definitions. It is used to implement a database of users/passwords/roles for authentication and container-managed security. To add/remove users or assign/unassign roles to existing users, edit this file.
  • logging.properties: As the name suggests, it defines the logging properties of the Tomcat instances (such as startup logs).
  • web.xml: This defines the default values for all web applications loaded into this instance of Tomcat, at the time of startup of the Tomcat instance. If a web application has its own deployment descriptor, its content will always override the configuration settings specified in this default descriptor.
  • context.xml: The contents of this file will load with every application. Configuration of parameters such as session persistence, Comet connection tracking, and so on, are done here.

Note

Any changes made in the server.xml file will be in effect after restarting the Tomcat instance.

Tip

Application level resources are not defined in the web.xml of the configuration folder. It would be better to define these in the application web.xml.

主站蜘蛛池模板: 高雄县| 东乌珠穆沁旗| 富蕴县| 大庆市| 永宁县| 错那县| 且末县| 开远市| 固镇县| 洛浦县| 巩义市| 大洼县| 玛多县| 霞浦县| 乡宁县| 平邑县| 桂林市| 靖宇县| 康马县| 铜川市| 高平市| 白城市| 丰镇市| 广宁县| 北京市| 中方县| 郑州市| 封丘县| 南靖县| 竹溪县| 江西省| 固安县| 宝鸡市| 丹江口市| 醴陵市| 巩义市| 四平市| 错那县| 南昌县| 沛县| 专栏|