13.2. Cartridge Directory Structure
The required directories of a cartridge must conform to a set structure or the cartridge can fail to function properly. You can add additional directories and files as needed to support the function of your cartridge.
Required
files must exist for minimal OpenShift Enterprise support of the cartridge.Discretionary
files are recommended, but not necessary. For example,conf.d
is the standard file where a web framework installs itshttpd
configuration.Optional
files are not necessary. Use optional files to support additional cartridge functionality.

Figure 13.1. Cartridge Directory Structure
To support multiple software versions within one cartridge, create symbolic links between the
$cartridge_name/bin/control
file and the $cartridge_name/versions/$software_version/bin/control
file. Alternatively, use the $cartridge_name/bin/control
file as a shim to call the control
file for the desired version.
When creating an instance of your cartridge for use by a gear, OpenShift Enterprise copies the files, links, and directories from the cartridge library, with the exception of the
$cartridge_name/usr/
directory. The $cartridge_name/usr/
directory is symbolically linked to the gear's cartridge instance. This link enables all cartridge instances to share libraries and other data.
See Chapter 3, Locking Cartridges for details on customizing a cartridge instance.