Adoptable Cookbooks List

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

node["tomcat"]["keystore_file"] - Location of the file where the SSL keystore is located

node["tomcat"]["keystore_password"] - Generated by the secure_password method from the openssl cookbook; if you are using Chef Solo, set this attribute on the node

node["tomcat"]["truststore_password"] - Generated by the secure_password method from the openssl cookbook; if you are using Chef Solo, set this attribute on the node

node["tomcat"]["truststore_file"] - location of the file where the SSL truststore is located

node["tomcat"]["certificate_dn"] - DN for the certificate

node["tomcat"]["keytool"] - path to keytool, used for generating the certificate, location varies by platform

Prerequisites

Due to the multitude of Java implementations you might want to use, this cookbook does not attempt to address the installation of a JRE/JDK. Please make sure that Java has been configured on the machine prior to the application any resources or recipes shipped in this cookbook.

Usage

Simply include the recipe where you want Tomcat installed.

Due to the ways that some system init scripts call the configuration, you may wish to set the java options to include JAVA_OPTS. As an example for a java app server role:

Running Multiple Instances

To run multiple instances of Tomcat, populate the instances attribute, which is a dictionary of instance name => array of attributes. Most of the same attributes that can be used globally for the tomcat cookbook can also be set per-instance - see resources/instance.rb for details.

If they are not set for a particular instance, the base, home, config_dir, log_dir, work_dir, context_dir, and webapp_dir attributes are created by modifying the global values to use the instance name. For example, under Tomcat 7, with home /usr/share/tomcat7, home for instance "instance1" would be set to /usr/share/tomcat7-instance1. The port attributes - port, proxy_port, ssl_port, ssl_proxy_port, ajp_port, and shutdown_port - are not inherited and must be set per-instance, ajp_redirect_port is also not inherited but defaults to ssl_port. Other attributes that are not set are inherited unmodified from the global attributes. Each instance must define shutdown_port, and at least one of port, ssl_port or ajp_port.

If you only want to run specific instances and not the "base" tomcat instances, you can set run_base_instance to false.

Managing Tomcat Users

The recipe tomcat::users included in this cookbook is used for managing Tomcat users. The recipe adds users and roles to the tomcat-users.xml conf file.

Users are defined by creating a tomcat_users data bag and placing Encrypted Data Bag Items in that data bag. Each encrypted data bag item requires an 'id', 'password', and a 'roles' field. The data bag key is retrieved from the default location /etc/chef/encrypted_data_bag_secret.

Copyright:: 2010-2015, Chef Software, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.