Define a repository-based configuration for a specific instance only
This article outlines a repository-based configuration for a specific instance, detailing how to store configuration in the CRX repository as nodes of nodetype sling:OsgiConfig in ÃÛ¶¹ÊÓƵ Experience Manager.
Description description
Environment
ÃÛ¶¹ÊÓƵ Experience Manager
Issue/Symptoms
This article defines a repository-based configuration for a specific instance.
Resolution resolution
1. Configure the Apache Felix Web Management Console
The configuration on the Apache Felix Web Management Console (http://<
host>
:<
port>
/system/console/configMgr) is always specific for the current instance.
You can find a description in the documentation:Â
2. Repository-based configuration
It is also possible to store configuration in the CRX repository as nodes of nodetype sling:OsgiConfig.
For more information, seeÂ
With this method, it is possible to share configuration among several instances.
The name of these nodes must be equal to the Persistent Identity (PID) of the configuration (for example, the name of the service). If you look at http://<
host>
:<
port>
/system/console/configMgr, you see these names listed as service.pid properties. These configuration nodes have to be child-nodes of nodetype nt:folder with a name starting with config followed with a dot. All the run-modes that the config applies to are also separated with a dot.
·¡³æ²¹³¾±è±ô±ð²õ:Ìý³¦´Ç²Ô´Ú¾±²µ.²¹³Ü³Ù³ó´Ç°ù,Ìý³¦´Ç²Ô´Ú¾±²µ.±è³Ü²ú±ô¾±²õ³ó,Ìý³¦´Ç²Ô´Ú¾±²µ.²¹³Ü³Ù³ó´Ç°ù.»å±ð±¹,Ìý³¦´Ç²Ô´Ú¾±²µ.²¹³Ü³Ù³ó´Ç°ù.´Ú´Ç´Ç.»å±ð±¹
Run-Mode
It is possible to define which specific run-modes a specific instance runs on. By default, an author instance runs on run-mode author and a publish instance runs on run-mode publish. It is possible to define several run-modes for one instance (for example author, foo, and dev).
Set these run-modes as VM options.
For example, on the console:
java -Dsling.run.modes=author,foo,dev -Xmx256m -jar aem64-quickstart.jar
or in the start script:
# default JVM options
CQ_JVM_OPTS='-Dsling.run.modes=author,foo,dev'
The current run-modes of an instance are visible at http://<
host>
:<
port>
/system/console/status-slingsettings
Note:  It is not recommended to change or remove the default run-modes author and publish. Instead, simply add your specific run-modes to the default list of existing run-modes.
Note:  The same mechanism works for the repository-based bundle installation. Place the bundles below nodes of nodetype nt:folder with a name starting with install followed by a dot. All the run-modes that the bundles apply to are separated with a dot.
Example:  To have a specific SMTP mailserver configuration for all your instances running on run-mode foo, simply create a node with name config.foo and nodetype nt:folder in /apps/we-retail  and copy the node /libs/cq/config/com.day.cq.mailer.DefaultMailService Ìý³Ù´ÇÌý /apps/we-retail/config.foo  and adapt the properties smtp.host.
Example: To have a specific Logrotation configuration, use the configuration package in the KB article  and rename the node config for example to config.foo if the config should be taken for all your instances running on run-mode foo only.