Category: Technology

AEM Development Environment Setup – Windows

Adobe Experience Manager (AEM) is a comprehensive content management solution for building websites, mobile apps, and forms. It enables businesses to create, manage, and optimize digital customer experiences across multiple channels. Setting up an AEM development environment on Windows requires installing necessary software, configuring system variables, and running the AEM QuickStart JAR file. This guide outlines the step-by-step process to set up AEM for development purposes.

Step 1 – Install Required Software

  • Install Java JDK 8 or 11 on your system.
  • AEM QuickStart Jar and license details.

Step 2 – Edit System Environment Variables

  • Open System Properties → Advanced → Environment Variables.
  • Under System Variables, create a new variable:
    • Variable Name: JAVA_HOME
    • Variable Value: Set this to the path where JDK is installed (e.g., C:\Program Files\Java\jdk-11.x.x).
  • Edit the Path variable and add the bin folder path (e.g., C:\Program Files\Java\jdk-11.x.x\bin).

java home

java home

Step 3 – Create a folder structure for AEM. Copy your AEM jar file and license.properties file into your AEM folder, as shown in the screenshot below.

  • Two basic run modes can be installed: Author and Publish. The Author run mode is the environment that developers will use to create and manage content.
  • When developing most of the time you will be deploying code to an Author instance.
  • The Publish instance is the AEM environment in that visitors to your website will interact.
  • We are setting the development environment i.e.(author).

AEM Setup

Step 4 – Open the CMD (Command Prompt) in your folder hierarchy and unpack the JAR (Java Archive) file with command

“java –jar <aem-jar-file-name>.jar -unpack”

AEM Setup

Step 5 – After Unpacking the JAR file, you will see that crx-quickstart folder is automatically created.

AEM Setup

Step 6 – Open the crx-quickstart folder then you will see the multiple folders.

AEM Setup

Step 7 – Open the bin folder then you will see the multiple files.

AEM Setup

Step 8 – Modify AEM Configuration

Open the start.bat file in a text editor to change the AEM startup parameters such as port, run mode, host, etc.

AEM Setup

 

In this file you can configure the Port and Run Mode according to your requirements. For initial setup you should update the RAM/Memory by following below steps:

  1. Update memory settings from “-Xmx1024m -XX:MaxPermSize=256M” to “-Xmx4096m -XX:MaxPermSize=1024M”.
  2. To enable debugging mode, add “-Xdebug -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:30307”.

Final Step – To run AEM, double-click on the start.bat file to start the process.

  • AEM server will be up in 5 minutes(depending on your system configuration) and the aem console will open on port 4502.
  • Below screen will come up when the server is up and enters a password use admin.

AEM Setup

AEM Setup

Congratulations, you have completed the initial AEM Setup.

AEM Content Distribution – Forward Distribution

AEM distribution agents execute the requests by creating packages from a source Sling instance containing content for the specified paths and then pushing and installing these on a target instance.

In AEM, the distribution agent is used to push the content from the author instance to the publish instance. AEM provides the following way to replicate content:

  • Forward Distribution: “pushing” the content to target instances

  • Reverse Distribution: “pulling” content from the remote source instances

  • Sync Distribution: “synchronizing,” i.e., synchronizing content across multiple instances with a coordinating instance.

  • If you want to configure or create a forward distribution agent in the AEM touch UI, you must follow this step.

    1. Navigate to Tools > Deployment > Distribution > Publish Agent, and click on the Publish Agent to configure your settings.
      AEM Content Distribution - Aurx

    2. You can also create your custom agent by clicking on the Create button on the top right.

      And fill in some information about your agent.

      Note: Always keep in mind that when you provide a name to your custom agent, there should be no spaces between that name; otherwise, “JobHandlingDistributionQueue” could not add an item to the queue.

      Example:

      Non-compliant name: Distribution Agent (it will raise a NullPointerException)
      Compliant name: customDistributionAgent
      AEM Content Distribution - Aurx

      AEM Content Distribution - Aurx
      Configuration Field List:

      1. Name: name of distribution Agent

      2. Type: Type of Distribution Agent (ex: Forward distribution or Reverse distribution)

      3. Title: Title of your distribution agent

      4. Enabled: Field to Enable or Disable your agent

      5. Service Name: The service name is optional, if required, create a service user with the required permission and change the level if required

      6. Allowed roots: Configure the content Roots the agent allowed to distribute

      7. Importer Endpoints: List of publisher endpoints to which packages are sent

        An endpoint is, by default:

        endpoint0=http://localhost:4503/libs/sling/distribution/services/importers/default

        But you can provide your server-specific endpoint URL, like:

        endpoint0=http://192.168.29.76:4503/libs/sling/distribution/services/importers/customDistributionAgent.

        But for your own definition of endpoint URL, you have to configure something.

    3. If you are not using the default admin credentials, then you need to configure the distribution agent with a different username and password.
      Follow the steps below:

      1. Navigate to Tools > Operations > Web Console or http://<host>:<port>/system/console/configMgr to open the Adobe Experience Manager Web Console screen.
      2. Search for Apache Sling Distribution Transport Credentials – User Credentials based DistributionTransportSecretProvider.
        AEM Content Distribution - Aurx
      3. Create a configuration by populating the name, username, and password.
        AEM Content Distribution - Aurx
        Configuration Field List:

        1. Name: Give a name to DistributionTransportSecretProvider

        2. User Name: Name of your publish instance user

        3. password: Password of your publish instance user

      4. Click save.
      5. Use Cmd +F to search for Apache Sling Distribution Agent – Forward Agents Factory to open the configurations and search for Transport Secret Provider.
        AEM Content Distribution - Aurx
      6. Update the (name=default) with (name=customDistributionAgent)
      7. In the publish instance, navigate to Tools > Operations > Web Console or hit this URL: http://<publish_host>:<publish_port>/system/console/configMgr.
      8. Click Save and run the test connection again from the Distribution Agent screen on your AEM instance.
      9. Click Test Connection from the action bar to validate the communication of the author with the publish instance, as shown in the figure below.
        AEM Content Distribution - Aurx
        Now we are ready with the forward content distribution agent but it will not be used in the replication process if we publish any page from the sites console because AEM uses default replication agent completes that publication. Here below, we will understand this in a more efficient manner.
        AEM Content Distribution - Aurx
        If we want to publish any page, then we click on that page and click on Quick Publish, so our page will be published. But now the default replication agent is working, not our custom distributed agent. We can check this in the logs of both agents. I published a /content/we-retail/language-masters/en/experience/arctic-surfing-in-lofoten page.
        Note: If you want to check the logs of the default replication agent, then you should navigate to Tools > Deployment > Replication > Agent Author and click on the default agent (author). Click on View Log.
        AEM Content Distribution - AurxAEM Content Distribution - AurxAEM Content Distribution - Aurx
        When we compare both images, there are no logs printed in our customeDistributionAgent. While in aem default replication agent did the publication.
        In AEM out-of-the-box functionality, by default, when we publish any content, the automatic replication agent invokes and completes the process of publication. If we want to use our distribution agent, then we should do some configuration in the AEM replication default agent.

        To activate our distribution agent for the default distribution agent, we have to do more configuration; until now, our distribution agent is ready.

        Navigate to Tools > Deployment > Replication > Agents on Author and click on the Default Agent (Publish) to configure the setting.