On Prem AEM 6.5 Publish and Dispatcher Configuration in Linux Environment (On Docker)
This is probably an old topic, considering most organizations are moving to AEMaaCS or AMS, this topic may not remain valid for a longer, but since I’ve done some work on this recently, I would like to share here.
Below are the tasks required to configure AEM 6.5 on linux environment. Consider I am using RedHat Linux on Docker environment for this. It’ll be all required steps to configure the same with only commands. These steps are peformed inside Linux Environment :)
- Install JAVA
yum install java-11-openjdk
More details can be found here
2. Install Apache
yum install httpd
Test if Apache is serving the requests on port 80 by using ps command.
ps -eo comm,etime,user | grep apache2
ps -eo comm,etime,user | grep root | grep apache2
More details can be found here.
3. AEM Publish Set up
a. Download AEM binary from Software Distribution site and rename it to aem-publish-p4503.jar. Put the jar at below mentioned paths.
/mnt/aem/author/aem-author-p4502.jar. (If you’re doing author installation too)
/mnt/aem/publish/aem-publish-p4503.jar
b. Unpack the jar using below command. Which this is happening provide admin user and password.
java -Xmx4096M -jar aem-publish-p4503.jar -r publish,nosamplecontent -unpack
c. Run the jar file using below command.
java -Xmx4096M -jar aem-publish-p4503.jar -r publish,nosamplecontent
4. AEM Dispatcher Set up
a. Install mod_ssl using below command
yum install mod_ssl
b. Create certificate files as per organization policies. For example below command is used for sample certificate file.
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/httpd/ssl/<<yourkeyfile>>.key -out /etc/httpd/ssl/<<yourkeyfile>>.crt
This will need to be verified certificates to work with Apache Server correctly.
In /etc/httpd/conf.d open the file ssl.conf and change the certificate names as per the generated certificates in above step.
c. I have used OOTB dispatcher module code that comes with AEM 6.5 project. The same can be obtained by creating a new AEM 6.5 project using latest ArcheType.
d. The code should have conf.d, conf.dispatcher.d and conf.modules.d folders. These need to be placed in Apache2 folder at the same level as conf folder.
e. A dispatcher file appropriate for the linux version will be needed, which can be downloaded from https://experienceleague.adobe.com/en/docs/experience-manager-dispatcher/using/getting-started/release-notes.
I’ve used this — dispatcher-apache2.4–4.3.7.so from
which is suitable for RedHat Linux.
dispatcher-apache2.4-linux-i686-ssl3.0-4.3.7.tar.gz
f. Test Apache http server is working with mod_ssl module correctly first.
Following files need to be modified for every AEM instance
- Update the SSL entries in \conf.d\enabled_vhosts\yourorg_publish.vhost
Define DISP_ID
Define PUBLISH_IP
Define PUBLISH_DEFAULT_HOSTNAME
Define PUBLISH_DOCROOT /var/www/html/publish
Same can be done for author.
g. Use below commands to configure
#copy dispatcher file to modules (this location for httpd/apache can be different for different systems)
cp dispatcher-apache2.4-4.3.7.so /usr/lib64/httpd/modules
cd /usr/lib64/httpd/modules
ln -s dispatcher-apache2.4-4.3.7.so mod_dispatcher.so
cp -r conf.d /etc/httpd
cp -r conf.dispatcher.d /etc/httpd
cp -r conf.modules.d /etc/httpd
#I have not used below command, use it if required
sudo setsebool -P httpd_can_network_connect 1
sudo chown -R apache /mnt/aem/var/
#To reload apache, this can be different for different linux systems
systemctl reload httpd
h. Refer to the file \etc\httpd \conf.d\enabled_vhosts\aem_publish.vhost and <VirtualHost *:443> tag for SSL configuration related to publish dispatcher.