Additional run modes are needed.
Run modes allow configuring CQ and AEM instances for specific purposes. For example, author instances use the author runmode, publish instances use the publish runmode.
Once set, run modes are used to tune each instance. This is done by defining collections of configuration parameters for each run mode or combination of run modes. Default sets of configurations are applied to all run modes.
Important: the run mode of an instance cannot be changed from author to publish, or vice versa, once a CQ or AEM instance has been installed. Some run modes, such as the author run mode and the publish run mode, are mutually exclusive. If both are specified, only the first run mode will be used.
Customized run modes can be used as well. These are use to differentiate instances by purpose, stage of development, or location. Within a development cycle, there may be separate environments for the stages of development. Common stages include development, staging, QA, and production. Run modes may be specified for difference locations and facilities. Examples of more complex run modes include:
- author, development
- publish, test
- author, intranet, us
Set Publish or Author Run Mode Using Quickstart Naming
When first installing AEM or CQ, the name of the quickstart jar can be used to determine whether the instance will use the author run mode or the publish run mode.
The naming convention to use for CQ 5.6 and before is:
The naming convention to for AEM 5.6.1 and later is:
As an example, the quickstart jar for an AEM 6.0 instance running as an author instance with the port of 4502 could be named:
Set Up Run Modes Using the Sling Properties File
Run mode(s) can be specified within the sling.properties file. This file can be found at <cq-installation-dir>/crx-quickstart/launchpad/sling.properties. Set the property, sling.run.modes, to a comma-delimited list of run modes to be applied.
Set Up Run Modes Using JVM Arguments
A JVM argument, -Dsling.run.modes, may be used to specify run mode(s) as well. This arguments may be used on the command line, as a system property or within a startup script.
java -Xmx512m -jar cq-quickstart-5.6.1.jar -Dsling.run.modes=publish,prod,us
Behavior When Run Modes Are Specified More than One Way
The run mode specified in the naming of the jar file takes precedence. If run modes are not specified in the naming of the jar file, the values in the sling.properties file are used. If run modes are not specified in the either the naming of the jar file or the sling.properties file, the system property (or JVM argument) is used.