You are on page 1of 4

Environment setup in Linux machine

Setting up AEM
Create the folder /opt/aem6/ and copy the jar and licence.properties files. We can use WinSCP client to
transfer files from our machine to user home folder of Linux box.

mkdir /opt/aem6
cd $home
cp licence.properties /opt/aem6
cp aem-6.0.0.20140515-generic.jar /opt/aem6

Start the server using the below command. The below command is for author server. For publish, please
change author to publish. In order to have custom run mode like dev, qa, prod etc., add the same
comma separated after –r in the below command. If we do not need sample content (geometrixx etc),
then add nosamplecontent to run mode.

java -Xmx8192m -XX:+HeapDumpOnOutOfMemoryError -XX:MaxPermSize=1024m -jar aem-


6.0.0.20140515-generic.jar -r author,crx3 -p 4502 -nofork

After starting server, stop it and then go to /opt/aem6/crx-quickstart/bin and update start shell script
with new run modes, port, nofork and JMX params.

Copy below aem start up script to /etc/init.d. Create file named aem inside /etc/init.d and copy below
content. In case if you are creating file from windows machine and transferring the same to Linux
machine, then run command dos2unix aem.

#!/bin/sh
#/etc/init.d/aem
#chkconfig:35 85 15
#description:aem startup script for publish the actual scripts are in /opt/aem6/crx-quickstart/bin/
#processname:aem
#pidfile:/crx-quickstart/conf/cq.pid
#Source function library
. /etc/rc.d/init.d/functions
CQ_ROOT="/opt/aem6"
CQ_USER="root"
SERVER="${CQ_ROOT}/crx-quickstart"
START="${SERVER}/bin/start"
STOP="${SERVER}/bin/stop"
STATUS="${SERVER}/bin/status"
usage(){
echo "Usage: $0 {start|stop|restart|status}"
#exit 0
}

if [ $0 != 1 ]; then
usage
fi
start(){
echo -n "Starting cq:"
su - ${CQ_USER} ${START}
/etc/init.d/iptables stop
touch /var/lock/subsys/aem
}
stop(){
echo -n "Stopping cq:"
su - ${CQ_USER} ${STOP}
rm -f /var/lock/subsys/aem
}
status(){
su - ${CQ_USER} ${STATUS}
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
status
;;
*)
usage
;;
esac
exit 0

Add above file to server startup by executing the following commands

cd /etc/init.d
chmod 755 aem
chkconfig --add aem
chkconfig --level 35 aem on
ln --s /etc/init.d/aem /etc/rc2.d/S35aem

Now you can start aem as "service aem start" and stop as "service aem stop". Also this automatically
starts the server on reboot.

Apache and dispatcher setup


Install httpd server

# Check to see if httpd is already present


which httpd
# if not present, use yum to install the httpd server
yum install httpd.x86_64
#verify installation
httpd --v

Obtain the latest CQ dispatcher release from Adobe. Unpack the zip and copy the modules and config.

tar --zxf dispatcher-apache2.2-linux-x86-64-4.1.7.tgz


cp modules/* /etc/httpd/modules
cp conf/dispatcher.any /etc/httpd/conf/
cd /etc/httpd/conf
cp httpd.conf httpd.orig.conf

Add the Loadmodule for dispatchermodule and paste the below configuration to httpd.conf

LoadModule dispatcher_module modules/mod_dispatcher.so

<IfModule disp_apache2.c>
DispatcherConfig conf/dispatcher.any
DispatcherLog logs/dispatcher.log
DispatcherLogLevel 1
DispatcherNoServerHeader 0
DispatcherDeclineRoot 0
DispatcherUseProcessedURL 0
DispatcherPassError 0
</IfModule>
<Directory />
<IfModule disp_apache2.c>
SetHandler dispatcher-handler
ModMimeUsePathInfo On
</IfModule>
Options FollowSymLinks
AllowOverride None
</Directory>

Change the document root to /var/www/html/disp_cache. Now save the httpd.conf

Since the dispatcher requires a writeable cache directory configured in dispatcher. Execute the following
commands

mkdir --p /var/www/html/disp_cache


chown apache /var/www/html/disp_cache
chmod 775 /var/www/html/disp_cache

Edit the dispatcher for render, filters and cache location (docroot). Save dispatcher.any

Restart web-server using "service httpd restart"

You might also like