Monday, January 15, 2018

Setup local AEM instance (with AEM Forms Package)

This article describes the steps for setting up a new AEM instance for working locally.

Please note: This is not for team development and certainly not for production use, it's just some quick pointers to get a novice going.

Note, these instructions include AEM Forms as well

My Setup:

Since detailed instructions are often dependent on having the right versions of things, here's a summary of my environment:
  • Ubuntu Linux 16.10
  • Oracle JDK 1.8.0_151
  • AEM 6.3

Step 1: Get the installation files.


You will need the following installation files to set yourself up with an AEM forms environment:
  1. AEM quickstart jar file (for example: AEM_6.3_Quickstart.jar)
  2. License file (for example: license.properties)
Note 1: If you don't have the quickstart jar, you can obtain it from Adobe

Note 2: If you don't have a license file, then you can obtain a license key from Adobe. When starting up AEM for the first time, you will need to enter the license key and then it will automatically create the license file.

Step 2: Create a folder for your installation

AEM is an Apache Sling application, so you can simply run it from the JAR file. when running the JAR, AEM unpacks itself, so it is useful to do this in a logical place.

On my machine I  like to do this in the home folder at ~/Software/AEM63Stack, but you may have a different preference.

Within the primary folder I like to create two subfolders, one for an author and one for a publish instance.

Paste both files in the author subfolder and the publish subfolder. Once pasted rename the two jars as follows:
  • Author jar: aem-author-6.3.0-p4502.jar
  • Publish jar: aem-publish-6.3.0-p4503.jar

This tells the AEM engine what instance type each will be used for as well as the port to use.

Here's what my folder looks like at this stage:

.
├── author
│   └── aem-author-6.3.0-p4502.jar
└── publish
    └── aem-publish-6.3.0-p4503.jar

Step 3: Create a startup shell script (Optional)

I like to have a shell script that I run when starting up AEM. It just makes it easier, and it creates an alternative to double-clicking the quickstart jar. Later one this can be replaced with more robust scripts that start and stop AEM.

In the author sub-folder, create a file called "aemstart.sh"

Add this content to the file:
#!/bin/bash 
echo "Starting up AEM 6.2"
java -jar aem-author-6.3.0-p4502.jar -nointeractive -gui

Give the file execute permissions:
chmod +x aemstart.sh
 .
├── author
│   ├── aem-author-6.3.0-p4502.jar
│   ├── aemstart.sh
│   ├── crx-quickstart
│   └── licenAEM-CFP-6.3.1.1se.properties
└── publish
    ├── aem-publish-6.3.0-p4503.jar
    └── aemstart.sh

Now copy the file to your publish sub-folder as well.

Here's what my folder looks like at this stage:

.
├── author
│   ├── aem-author-6.3.0-p4502.jar
│   └── aemstart.sh
└── publish
    ├── aem-publish-6.3.0-p4503.jar
    └── aemstart.sh

Step 4: Start up AEM Author

Now you're ready to start up AEM. Open a terminal in the location where the aemstart.sh file was created (for your author instance) and simply run:
./aemstart.sh

The first time you run this, it'll be a bit slow because it is actually unpacking the JAR and setting up your AEM server. On subsequent loads it is a bit faster.

Upon executing the script, an AEM dialog will appear with a progress bar showing how the startup is progressing.

If you look in the "author" folder you will notice that a new sub-folder has been created, named "crx-quickstart" this is where the actual AEM server sits.

Once AEM is started up, a browser window will automatically open up pointing to the server at localhost:
  • If a license file was supplied the browser will open on the AEM login page.
  • If a no licence file was provided the browser will open on a page allowing your to capture your license key. After the key is supplied, you will also be taken to the login page

You can login with admin, admin

Here's what my folder looks like after starting up the author for the first time:

.
├── author
│   ├── aem-author-6.3.0-p4502.jar
│   ├── aemstart.sh
│   ├── crx-quickstart
│   └── license.properties
└── publish
    ├── aem-publish-6.3.0-p4503.jar
    └── aemstart.sh

Step 5: View your logs

AEM provides a number of useful logs that you should tail while developing. All the logs are stored at crx-quickstart/logs

The most important logsto look at initially are:
  • request.log: This records all REST requests sent to the Sling server
  • error.log: This is the log where all AEM messages are written 

 

Step 6: Setup AEM Forms Package

Once you're logged into AEM, go to the package share:
  • http://localhost:4502/crx/packageshare
  • Or navigate: Tools > Deployment > Package Share
You'll have to log into package share with your Adobe ID.

Once logged into Package Share, search for the Forms Add on package for your Operating system. In my case it is called: AEM-FORMS-6.3.1.2-LX

Once the package is finished downloading you can click on the "Downloaded" button. This will navigate you to the package manager (http://localhost:4502/crx/packmgr) where you can simply install the package that was just downloaded.

All that's needed now is to click on Install, to install the package

Note: If the package has unfulfilled dependencies, it will not install. You will need to first download and install the relevant dependencies. In my case I needed to download and install the following packages (in order):
  • AEM-6.3-SERVICE-PACK-1
  • AEM-CFP-6.3.1.1
  • AEM-FORMS-6.3.1.2-LX
You'll need to restart your AEM instance when all of this is done.

FAQ:

What about the publish instance?

I've excluded the publish instance for this article, but will explore it in a future article.

 

References:

  • https://helpx.adobe.com/support/experience-manager/6-3.html