Installation and Configuration - bartoszWesolowski/aem-tips GitHub Wiki

Installing AEM

Technical requirements

Prerequisites:

  • Installed Java Platform, Standard Edition JDK, or other supported Java Virtual Machines
  • AEM Quickstart file (jar/war) and license file
  • min 5GB of free disk space and min 2GB of memory
  • Java 1.8 (AEM 6.4), 1.8 and 11 (AEM 6.5)

Recommended hardware parameters:

TODO: Basic info from docs

Local installation

Place AEM jar file and license in same directory

<aem-install>/
    cq-quickstart-6.4.0.jar
    license.properties - without this AEM will open we browser that will request license key

AEM can be started locally in with GUI environment (by double click on a jar file) or with command line

java -Xmx1024M -jar cq-quickstart-6.4.0.jar
//or 64-bit VM
java -XX:MaxPermSize=256m -Xmx1024M -jar cq-quickstart-6.4.0.jar

Starting AEM for the first time will unpack the jar file and install AEM (this might take couple of minutes).

By default AEM will start and Author instance on port 4502. This can be changed by arguments passed in the command line or simply by renaming the jar file with the following template

Template: cq-<instance-type>-p<port-number>.jar
cq-author-p4502.jar - author on port 4502
cq-publish-p4503.jar - publish on port 4503

Starting and Stopping

Instance can be stopped with GUI or using scripts available in unpacked AEM content under:

/crx-quickstart/bin/

with scripts to start and stop the instance. There is also a script status that reports the status of the instance and a quickstart script to configure start information. All scripts available in two versions for shell and Windows.

Start script supports a list of environment variables like CQ_PORT, CQ_RUNMODE, CQ_JARFILE (and more) that can be used to customize AEM insance, for more details see Command Line Start and Stop Adobe Documentation

Run Modes

Run modes allow you to tune your AEM instance for a specific purpose; for example author or publish, test, development, intranet or others. Run modes allows to:

  • Define collections of configurations to be applied for particular run mode
  • Define additional bundles to be installed for particular mode
  • Instance run modes can be checked under /system/console/status-slingsettings

Fixed run modes

Can be set when AEM is installed (started for the first time) and can not change later on. There are 4 fixed run modes author/publish and samplecontent/nosamplecontent (only one from each pair can be used at the same time). If both are specified, only the first run mode is used.

Production installations should use nosamplecontent run mode.

Customized Run Modes

Can be selected at each startup. Custom run modes can represent the instance type for example dev, integration, staging and can be define as required.

Defining additional bundles to be installed and OSGI configs to be used for a run mode

Additional bundles that should be installed for a particular run mode can also be specified. For these definitions, install folders (nt:folder) are used to hold the bundles. Again the run mode is indicated by a prefix: install.author install.publish

Applying desired configuration per run mode can be done by creating a folder with a run mode suffix on the folder name, for example config.author, config.prod

Starting AEM with specific run mode

Methods to configure run modes (with the order of resolution):

  1. Filename detection (only for author/publish run modes set in the AEM jar file name)
  2. sling.properties
  3. -r command line param, for example java -jar cq-56-p4545.jar -r dev (it can also use -Dsling.run.modes parameter)
  4. system properties CQ_RUNMODE

** Sling properties file **

  • <cq-installation-dir>/crx-quickstart/conf/sling.properties.
  • property name: sling.run.modes
  • example: sling.run.modes=publish,development

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 either the naming of the jar file or the sling.properties file, the system property (or JVM argument) is used.

Change location of temp directory

The default location of the temporary folder of the java machine is /tmp . AEM uses this folder too, for example when building packages.

If you want to change the location of the temporary folder (for example, if you need a directory with more free space) then define a <new-tmp-path> by adding the JVM parameter: -Djava.io.tmpdir="/<new-tmp-path>" to either:

  • the server startup command line
  • the CQ_JVM_OPTS environment parameter in the serverctl or start script

Command line options for the Quickstart jar

  • -help
  • -p, -port, -quickstart.server.port - sets the port
  • -gui - Show GUI if running on a terminal
  • -v (-verbose) - Do not redirect stdout/stderr to files and do not close stdin
  • -r - to specify run modes
  • -unpack - just unpacks the jar and does not start the instance

For all options see Further options available from the Quickstart file section in Adobe documentation

Note that parameters passed as command line argument takes precedence over run mode and port that can be set up in the file name. Running java -jar -Xmx1024M cq-author-p4502.jar -r publish -p 4503 will run publish on 4053 port

Enabling debug

To start AEM with debug mode this JVM parameter must be added to command that starts AEM: -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n. This can done by adding this param to CQ_JVM_OPTS variable (if AEM is started with start script) or passed directly to command (8000 is the default port and can be changed).

Adobe documentation