May 12, 2020
Estimated Post Reading Time ~

Installing AEM

In AEM terminology an “instance” is a copy of AEM running on a server. AEM installations usually involve at least two instances, typically running on separate machines:
  • Author: An AEM instance used to create, upload and edit content and to administer the website. Once content is ready to go live, it is replicated to the publish instance.
  • Publish: An AEM instance that serves the published content to the public.
These instances are identical in terms of installed software. They are differentiated by configuration only. In addition, most installations use a dispatcher:
  • Dispatcher: A static web server (Apache httpd, Microsoft IIS, etc.) augmented with the AEM dispatcher module. It caches web pages produced by the publish instance to improve performance.
There are many advanced options and elaborations of this setup, but the basic pattern of author, publish and dispatcher is at the core of most deployments. We will  begin by focusing on a relatively simple set up.
On the author environment the functionality of AEM is made available through two UIs. For the publish environment you design the entire look-and-feel of the interface made available to your users.

Author Environment

The author works in what is known as the author's environment. This provides an easy to use interface (graphical user interface (GUI or UI)) for creating the content. It is usually located behind a company’s firewall that provides full protection and requires the author to login, using an account that has been assigned the appropriate access rights.
Depending on how your instance and your personal access rights are configured you can perform many tasks on your content, including (amongst others):
  • generate new content, or edit existing content, on a page
  • use predefined templates to create new content pages
  • create, edit and manage your assets and collections
  • create, edit and manage your publications
  • develop your campaigns and the related resources
  • develop and manage community sites
  • move, copy or delete content pages, assets, etc
  • publish (or unpublished) pages, assets, etc
Additionally, there are administrative tasks that help you manage your content:
  • workflows that control how changes are managed; for example. enforcing a review before publication
  • projects that coordinate individual tasks

Publish Environment

When ready, the AEM site’s content is published to the publish environment.  Here the website’s pages are made available to the intended audience in accordance with the look-and-feel of the designed interface.
Usually, the publish environment is located inside the demilitarized zone; in other words, available to the internet, but no longer under the full protection of the internal network.
When the AEM site is a community site, or includes Communities components, signed-in site visitors (members) may interact with Communities features.  For example, they may post to a forum, post a comment, or follow other members.  Members may be granted permission to perform activities normally limited to the author's environment, such as create new pages (community groups), blog articles, and moderate other members’ posts. Unfortunately, there is sometimes an overlap in the terminology used. This can happen with:
  • Publish / Unpublish – These are the primary terms for the actions that make your content publicly available on your publish environment (or not).
  • Activate / Deactivate – These terms are synonymous with publish/unpublish. They are more common in the classic UI.
  • Replicate / Replication – These are the technical terms used to indicate the movement of data (e.g. page content, files, code, user comments) from one environment to another; i.e. when publishing, or reverse-replicating user comments.

Getting Started

PREREQUISITES

While production instances are usually run on dedicated machines running an officially supported OS (see Technical Requirements), the Experience Manager server will actually run on any system that supports Java Standard Edition 7.
For purposes of familiarization and for developing on AEM it is quite common to use an instance installed on your local machine running Apple OS X or desktop versions of Microsoft Windows or Linux.
On the client-side, AEM works with all modern browsers (Internet Explorer 9+, ChromeFirefoxSafari 6+) on both desktop and tablet operating systems. See Supported Client Platforms for details.

GETTING THE SOFTWARE

Customers with a valid maintenance and support contract should have received a mail notification with a code and be able to download AEM from the Adobe Licensing Website. Business partners can request download access from spphelp@adobe.com.
The AEM software package is available in two foms:
  • cq-quickstart-6.1.0.jar: A standalone executable jar file that includes everything needed to get up and running.
  • cq-quickstart-6.1.0.war: war file for deployment in a third-party application server.
In addition, you will also need a license code (to be entered on start-up) or a license.properties file, holding a valid code.
In the following section, we describe the standalone installation. For details on installing AEM in an application server see Application Server Install.

DEFAULT LOCAL INSTALL

  • Create an install directory on your local machine. On a UNIX machine, this might be
        /opt/aem
    In Windows, it might be
        C:\Program Files\aem
    Equally, it is common to install sample instances in a folder right on the desktop. In any case, we will refer to this location generically as
    <aem-install>
    Note that the path of the file directory must consist of only US ASCII characters.
  • Place the the jar and license files in this directory:
    <aem-install>/
        cq-quickstart-6.1.0.jar
        license.properties
    Code samples are intended for illustration purposes only.
    If you do not provide a license.properties file, AEM will redirect your browser to a Welcome screen on startup, where you can enter a license key. You will need to request a valid license key from Adobe if you do not yet have one.
    To start up the instance in a GUI environment, just double-click the cq-quickstart-6.1.0.jar file.
    Alternatively, you can launch AEM from the command line. For a 32-bit Java VM enter the following:
    java -Xmx1024M -jar cq-quickstart-6.1.0.jar
    Code samples are intended for illustration purposes only.
    For a 64-bit VM, enter:
    java -XX:MaxPermSize=256m -Xmx1024M -jar cq-quickstart-6.1.0.jar
    Code samples are intended for illustration purposes only.
AEM will take a few minutes to unpack the jar file, install itself, and start up. The above procedure results in:
  • an AEM author instance
  • running on localhost
  • at port 4502
To access the instance point your browser to:
http://localhost:4502
The result in the author instance will be automatically configured to connect to a publish instance on localhost:4503.

AUTHOR AND PUBLISH INSTALLS

The default install (an author instance on localhost:4502) can be changed simply by renaming the jar file before launching it for the first time. The naming pattern is
cq-<instance-type>-p<port-number>.jar
For example, renaming the file to
cq-author-p4502.jar
and launching it will result in an author instance running on localhost:4502.
Similarly, renaming and launching the file
cq-publish-p4503.jar
will result in a publish instance running on localhost:4503.
You would install these two instances in, for example
<aem-install>/author  and
<aem-install>/publish

UNPACKED INSTALL DIRECTORY

When the quickstart jar is launched for the first time it will unpack itself into the same directory under a new sub-directory called crx-quickstart. You should end up with the following:
<aem-install>/
    license.properties
    cq-quickstart-6.1.0.jar
    crx-quickstart/
        app/
        bin/
        conf/
        launchpad/
        logs/
        monitoring/
        opt/
        repository/
        eula-de_DE.html
        eula-en_US.html
        eula-fr_FR.html
        eula-ja_JP.html
        readme.txt
Code samples are intended for illustration purposes only.
If the instance was installed from the GUI, then a browser window will open automatically and a desktop application window will also open displaying the host and port of the instance and an on/off switch:

STARTING AND STOPPING

Once AEM has unpacked itself and started up for the first time, double clicking on the jar file in the install directory simply starts the instance, it does not re-install it.
To stop the instance fom the GUI, simply click the on/off switch on the desktop application window.
You can also stop and start AEM from the command line. Assuming you have already installed the instance for the first time, the command-line scripts are located here:
<aem-install>/crx-quickstart/bin/
This folder contains the following Unix bash shell scripts:
  • start: Starts the instance
  • stop: Stops the instance
  • status: Reports the status of the instance
  • quickstart: Used to configure start information, if necessary.
There are also equivalent bat files for Windows. For more detailed information see:
AEM starts and automatically redirects your web browser to the appropriate page, usually the login page; for example:
http://localhost:4502/
Once logged in, you have access to AEM. For further information, depending on your role.

Custom Standalone Install

CHANGING THE PORT NUMBER BY RENAMING THE FILE

The default port for AEM is 4502. If that port is not available or already in use, Quickstart automatically configures itself to use the first available port number as follows: 4502, 8080, 8081, 8082, 8083, 8084, 8085, 8888, 9362, <random>.
You can also set the port number by renaming the quickstart jar file so that the file name includes the port number; for example, cq5-publish-p4503.jar or cq5-author-p6754.jar.
There are various rules to be followed when renaming the quickstart jar file:
  • When you rename the file, it must start with cq; as in cq5-publish-p4503.jar.
  • It is recommended that you always prefix the port number with -p; as in cq5-publish-p4503.jar or cq5-author-p6754.jar.

NOTE

This is to ensure that you do not need to worry about fulfilling the rules used for extracting the port number:
  • the port number must be 4 or 5 digits
  • these digits must come after a dash
  • if there are any other digits in the filename, then the port number must be prefixed with -p
  • the “cq5” prefix at the beginning of the filename is ignored
You can also change the port number by using the -port option in the start command.

RUN MODES

Run modes allow you to tune your AEM instance for a specific purpose; for example, author or publish, test, development, intranet, etc. These modes also allow you to control the use of sample content. This sample content is defined before the quickstart is built and can include packages, configurations, etc. This can be particularly useful for production-ready installations when you want to keep your installation lean and without sample content.
Run modes allow you to tune your AEM instance for a specific purpose; for example author or publish, test, development, intranet or others.
You can:
  • Define collections of configuration parameters for each run mode.
    A basic set of configuration parameters is applied for all run modes, you can then tune additional sets to the purpose of your specific environment. These are applied as required.
  • Define additional bundles to be installed for a particular model.
All settings and definitions are stored in the one repository and activated by setting the Run Mode.

INSTALLATION RUN MODES

Installation (or fixed) run modes are used at installation time and then fixed for the entire lifetime of the instance, they cannot be changed.
Installation run modes are provided out-of-the-box:
  • author
  • publish
  • samplecontent
  • nosamplecontent
These are two pairs of mutually exclusive run modes; for example, you can:
  • define either author or publish, not both at the same time
  • combine author with either samplecontent or nosamplecontent (but not both)

CAUTION

When using one of the above run modes (author, publish, samplecontent, nosamplecontent), the value used at installation time defines the run mode for the entire lifetime of that installation.
For these run modes, you cannot change them after installation.

CUSTOMIZED RUN MODES

You can also create your own, customized, run modes. These can be combined to cover scenarios such as:
  • author + development
  • publish + test
  • publish + test + golive
  • publish + intranet
  • as required . . .
Customized run modes can also be selected at each startup.

Using samplecontent and nosamplecontent

These modes allow you to control the use of sample content. The sample content is defined before the quickstart is built and can include packages, configurations, etc:
  • The samplecontent run mode will install this content (the default mode).
  • The nosamplecontent mode will not install the sample content.
The nosamplecontent run mode is designed for production installations.

Defining configuration properties for a run mode

A collection of values for configuration properties, used for a particular run mode, can be saved in the repository.
The run mode is indicated by a suffix on the folder name. This allows you to store all configurations in one repository. For example:
  • config
    Applicable for all run modes
  • config.author
    Used for author run mode
  • config.publish
    Used for publish run mode
  • config.<run-mode>
    Used for the applicable run mode; for example, config
See OSGi Configuration in the Repository for further details on defining the individual configuration nodes within these folders and for creating configurations for combinations of multiple run modes.

NOTE

For Installation Run Modes (e.g. author) the run mode cannot be changed after installation. However, changes to the individual configuration properties will take effect upon restart.

Defining additional bundles to be installed for a run mode

Additional bundles that should be installed for a particular run mode can also be specified. For these definitions, install folders are used to hold the bundles. Again the run mode is indicated by a prefix:
  • install.author
  • install.publish
These folders are of type nt:folder and should contain the appropriate bundle.

Starting CQ with a specific run mode

If you have defined configurations for multiple run modes then you need to define which is to be used upon startup. There are several methods for specifying which run mode to use; the order of resolution is:
  1. sling.properties file
  2. -r option
  3. system properties (-D)
  4. Filename detection
When you are using an application server you can also define the run mode in web.xml.

USING THE SLING.PROPERTIES FILE

The sling.properties file can be used to define the required run mode:
  1. Edit the configuration file:
    <cq-installation-dir>/crx-quickstart/conf/sling.properties
  2. Add the following properties; the following example is for author:
    sling.run.modes=author

USING THE -R OPTION

A custom run mode can be activated by using the -r option when launching the quickstart. For example, use the following command to launch an AEM instance with run mode set to dev.
java -jar cq-56-p4545.jar -r dev
Code samples are intended for illustration purposes only.

USING A SYSTEM PROPERTY IN THE START SCRIPT

A system property in the start script can be used to specify the run mode.
  • For example, use the following to launch an instance as a production publish instance located in the US:
    -Dsling.run.modes=publish,prod,us

FILENAME DETECTION – RENAMING THE JAR FILE

The following two installation run modes can be activated by renaming the installation jar file before installation:
  • publish
  • author
The jar file must use the naming convention:
cq5-<run-mode>-p<port-number>
For example, set the publish run mode by naming the jar file:
cq5-publish-p4503

DEFINING THE RUN MODE IN WEB.XML (WITH APPLICATION SERVER)

When you are using an application server you can also configure the property:
sling.run.modes
in the file:
WEB-INF/web.xml
This is in the AEM war file and should be updated before deployment.

ADDING A FILE INSTALL PROVIDER

By default, the folder crx-quickstart/install is watched for files.
This folder does not exist but simply can be created at runtime.
If a bundle, configuration, or content package is put into this directory, it is automatically picked up and installed. If it’s removed, it gets uninstalled.
It is another way to put bundles, content packages or configurations to the repository.
This is especially interesting for several use cases:
  • During development, it might be easier to put something into the file system.
  • If something goes wrong, the web console and the repository are not reachable. With this you can put additional bundles into this directory and they should get installed.
  • The crx-quickstart/install folder can be created before a quickstart is started, and additional packages can be put there.

INSTALLING AND STARTING ADOBE EXPERIENCE MANAGER AS A WINDOWS SERVICE

Be sure to perform the following procedure while logged on as Administrator or start/run these steps using the Run As Administrator context-menu selection.
Being logged on as a user with administrator privileges is insufficient. If you are not logged on as Administrator when completing these steps you receive Access Denied errors.
To install and start AEM as a Windows service:
  • Open the crx-quickstart\opt\helpers\instsrv.bat file in a text editor.
  • If you are configuring a 64-bit Windows server, replace all instances of prunsrv with one of the following commands, according to your operating system:
    • prunsrv_amd64
    • prunsrv_ia64
    This command invokes the appropriate script that starts the Windows service daemon in 64-bit Java instead of 32-bit Java.
  • To prevent the process from forking into more than one process, increase the maximum heap size and the PermGen JVM parameters. Locate the set jvm_options command and set the value as follows:
    set jvm_options=-XX:MaxPermSize=256M;-Xmx1792m
  • Open Command Prompt, change the current directory to the crx-quickstart/opt/helpers folder of the AEM installation, and enter the following command to create the service:
    instsrv.bat cq5
    To verify that the service is created, open Services in the Administrative Tools control panel or type start services.msc in Command Prompt. The cq5 service appears in the list.
  • Start the service by doing one of the following:
    • In the Services control panel, click cq5 and click Start.
    • In the command line, type net start cq5.
  • Windows indicates that the service is running. AEM starts and the prunsrv executable appears in Task Manager. In your web browser, navigate to AEM, for example, http://localhost:4502 to start using AEM.
The property values in the instsrv.bat file are used when creating the Windows service. If you edit the property values in instsrv.bat, you must uninstall and then reinstall the service.
When installing AEM as service, you must provide the absolute path for the logs directory in com.adobe.xmp.worker.files.ncomm.XMPFilesNComm from Configuration Manager.
To uninstall the service, either click Stop in the Services control panel or in the command line, navigate to the folder and type instsrv.bat -uninstall cq5. The service gets removed from the list in the Services control panel or from the list in the command line when you type net start.

REDEFINING THE LOCATION OF THE TEMPORARY WORK 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

FURTHER OPTIONS AVAILABLE FROM THE QUICKSTART FILE

Further options and renaming conventions are described in the Quickstart help file, which is available through the –help option. To access the help, type:
  • java -jar cq5-<version>.jar –help

VERIFYING THE INSTALLATION

The following links can be used to verify that your installation is operational (all examples are on the basis that the instance is running on port 8080 of the localhost, that CRX is installed under /crx and Launchpad under /):

ACTIONS AFTER INSTALLATION

Although there are many possibilities to configure AEM WCM, certain actions should be taken, or at least reviewed immediately after installation:
  • Consult the Security Checklist for tasks required to ensure that your system remains secure.
  • Review the list of default users and groups which are installed with AEM WCM. Check whether you want to take action on any other accounts – see Security and User Administration for further details.

ACCESSING CRXDE LITE AND THE WEB CONSOLE

Once AEM WCM has been started, you can also access:
  • CRXDE Lite – used to access and manage the repository
  • Web Console – used to manage or configure the OSGi bundles (also known as the OSGi Console)

Accessing CRXDE Lite

To open CRXDE Lite you can select CRXDE Lite from the welcome screen or use your browser to navigate to: http://<host>:<port>/crx/de/index.jsp

Accessing the Web Console

To access the Adobe CQ Web console you can select OSGi Console from the welcome screen or use your browser to navigate to
http://<host>:<port>/system/console
For example:
http://localhost:4502/system/console
or for the Bundles page
http://localhost:4502/system/console/bundles
See OSGi Configuration with the Web Console for further details.

TROUBLESHOOTING

For information on dealing with issues that may come up during installation, see:

UNINSTALLING ADOBE EXPERIENCE MANAGER

Because AEM installs into a single directory, there is no need for an uninstall utility. Uninstalling can be as simple as deleting the entire installation directory, although how you uninstall AEM depends on what you want to achieve and what persistent storage you use.
If persistent storage is embedded in the installation directory, for example, in the default TarPM installation, deleting folders removes data as well.

NOTE

Adobe highly recommends that you back up your repository before deleting AEM. If you delete the entire <cq-installation-directory>, you will delete the repository. To keep the repository data before deleting, move, or copy the <cq-installation-directory>/crx-quickstart/repository folder somewhere else before deleting the other folders.

If your installation of AEM uses external storage, for example, a database server, removing the folder does not remove the data automatically, but it does remove the storage configuration, which makes restoring the JCR content difficult.


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.