A shorter time to market is critical to product companies. With the growth in competition, it is important to deliver a fast, secure and seamless application experience. It is the usability of the application that will differentiate an organization from its competitors.
Adobe Experience Manager (or AEM), a component of the Adobe Marketing Cloud, is the leading enterprise content management platform for building websites and mobile applications along with managing digital assets and content. These applications need to be highly available and deployed over an easily scalable infrastructure.
Amazon Web Services (or AWS) provides a plethora of cloud services that can be used and integrated to build a complete solution architecture for such applications. AWS provides capabilities such as global capacity, security, reliability, fault tolerance, programmability, and usability.
An AEM instance is essentially a copy of the AEM jar running on a system on a specific port. These instances can be run on a single machine (using a different port for each instance) or various machines. This blog demonstrates the process of setting up AEM Author and AEM Publish instances, along with the Dispatcher on an AWS EC2 machine running on CentOS 7.
- AEM Author: The Author instance is used to design, create and review the content which will be published on the application in the future. The instance is located inside the organization’s firewall under the full protection of the internal network. It provides an easy GUI for the tasks and uses the port 4502 by default.
- AEM Publish: The Publish instance is used to make the designed application available to the public and is located in a demilitarized zone. The default port used by the instance is 4503.
- AEM Dispatcher: The Dispatcher is another instance used in AEM which handles instance security, load balancing, and caching from the Publish instance.
You need to ensure that the Apache HTTP Server and Java are running to set up AEM instances.
Install Apache
1
2
| sudo yum update sudo yum install httpd |
Install Java
1
| sudo yum install java-1.8.0-openjdk-devel |
Outlined below are the steps to set up AEM instances:
- Dispatcher
The dispatcher instance is configured using a dispatcher module (dispatcher-apache<x.y>-<rel-nr>.so) and a configuration file (dispatcher.any)
- Download the appropriate tar.gz from here
- Untar and remove the original tar file:12
tar -xvf dispatcher-apache-xxx.tar.gz
rm dispatcher-apache-xxx.tar.gz
- The directory structure is as follows:
- CHANGES
Changes comprise of issues resolved in each release
- Conf
These are configuration files for dispatcher
dispatcher-apache<x.y>-<rel-nr>.so : The Dispatcher shared object library file which will be added to the Apache webserver
- README
README contains installation instructions
- Make a softlink of the DSO file in the ‘modules’ directory of Apache1
ln -s /path/to/dispatcher/dispatcher-apache<x.y>-<rel-nr>.so /etc/httpd/modules/mod_dispatcher.so
- Copy the dispatcher.any file to ‘conf’ folder of Apache1
cp dispatcher.any /etc/httpd/conf/dispatcher.any
- Disable SELinux: SELinux (or Security-Enhanced Linux), if enabled, may cause some errors while running Dispatcher.
- Edit /etc/selinux/config:1
SELINUX=disabled
- Run
1
| /usr/sbin/setsebool httpd_can_network_connect true |
- Edit the configurations in /etc/httpd/conf/httpd.conf:
- Load module: to load module on start-up
- Add dispatcher configuration: Dispatcher-specific configuration entries
- SetHandler: to activate the dispatcher
- ModMimeUsePathInfo: to modify the behavior of mod_mime
Add the following lines:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
| Listen 80 Include conf.modules.d/*.conf LoadModule dispatcher_module /etc/httpd/modules/mod_dispatcher.so <IfModule disp_apache2.c> DispatcherConfig conf/dispatcher.any DispatcherLog logs/dispatcher.log DispatcherLogLevel 3 DispatcherNoServerHeader 0 DispatcherDeclineRoot 0 DispatcherUseProcessedURL 0 DispatcherPassError 0 DispatcherKeepAliveTimeout 60 </IfModule> <Directory /> <IfModule disp_apache2.c> SetHandler dispatcher-handler </IfModule> Options FollowSymLinks AllowOverride None </Directory> <Directory /> <IfModule disp_apache2.c> SetHandler dispatcher-handler ModMimeUsePathInfo On </IfModule> Options FollowSymLinks AllowOverride None </Directory> |
- Author and Publisher:
- To set up AEM, the AEM Quickstart Jar (AEM_6.x_Quickstart.jar) and License file (license.properties) are required. These files are always placed together to run the Author or Publish instance.
- Create directories for author and publisher
1
2
| mkdir -p /opt/aem/author mkdir -p /opt/aem/publish |
- Copy jar and license file and set appropriate names for jar files:
AEM author and publish instances are configured using run modes. For example, author instances use the author run mode and publish instances use the publish run mode.
These run instances can be configured through the naming of the jar file (cq5-<run mode>-p<port>.jar).
1
2
3
4
| cp AEM_6.x_Quickstart.jar /opt/aem/author/cq5-author-p4502.jar cp AEM_6.x_Quickstart.jar /opt/aem/publish/cq5-publish-p4503.jar cp license.properties /opt/aem/author/license.properties cp license.properties /opt/aem/publish/license.properties |
- Unpack jars:
The run mode of an AEM instance cannot be changed once it has been installed.
1
2
| java -jar /opt/aem/author/cq5-author-p4502.jar -unpack java -jar /opt/aem/publish/cq5-publish-p4503.jar -unpack |
Unpacking of the jar files creates a folder named ‘crx-quickstart’ which contains the script to start/stop the AEM instance and logs.
- Start the publish instance for the first time:
1
| java -jar /opt/aem/publish/cq5-author-p4502.jar -r publish |
- Edit start script of the publish instance:
Every AEM instance is an author instance by default. To configure the publish instance, set the following properties in /opt/AEM/publish/crx-quickstart/bin/start:
1
2
| CQ_PORT=4503 CQ_RUNMODE= 'publish' |
Stop and restart the publish instance using the scripts in crx-quickstart/bin/.
Note: The start script can be used to define various configurations of the instance, such as java heap memory.
- Edit /etc/httpd/conf/dispatcher.any
- Add virtual hosts (URI and hostname requests which the dispatcher will accept)
- Add the renderer (the server that provides the pages to be served, i.e., the publish instance).
Include the following:
1
2
3
4
5
6
7
8
9
10
11
| /virtualhosts { "*:80" } /renders { /rend01 { # Hostname or IP of the render /hostname "127.0.0.1" # Port of the render /port "4503” } } |
This configuration accepts all requests on port 80 and serves the pages provided by the publish instance on port 4503.
- Start the author instance using the start script.
1
| bash /opt/aem/author/crx-quickstart/bin/start |
You will be easily able to configure AEM by following the above steps on one or multiple AWS EC2 instances.
References:
1. Author and Publish
2. Dispatcher
1. Author and Publish
2. Dispatcher
No comments:
Post a Comment
If you have any doubts or questions, please let us know.