๐ AEM-UP
Inspired by AEM-Devbox
AEM Author, Publisher and Dispatcher in one VM With a logging server*. managed via Vagrant
and provisioned via Ansible
. "AEM-UP" comes from Vagrant up
command
*This VM runs a tailon server to show you logs in browser! no SSH necessary!
TL;DR:
Table of Contents
Table of contents generated with markdown-toc
Stack
Vagrant
Ansible
CentOs 7
vagrant image.
Requirements
vagrant 2.1.5
or higher Install VagrantAnsible 2.7
or higher Install Ansible- AEM JAR and license.
- Latest Dispatcher module*.
*Download from PackageShare. choose
Linux x86 64bit
for example:dispatcher-apache2.4-linux-x86-64-4.2.3.tar.gz
Setup
-
Add AEM JAR, license and dispatcher module:
copy your
cq-quickstart-<version>.jar
,license.properties
anddispatcher-apache2.4-<version>.so
touser-provided
folder.Pay close attention to step 2
Folder structure should look something like this:
.
โโโ LICENSE.md
โโโ README.md
โโโ Vagrantfile
โโโ binaries
โ โโโ tailon
โ โโโ LICENSE
โ โโโ README.md
โ โโโ tailon
โโโ dispatcher
โ โโโ 00-dispatcher.conf
โ โโโ dispatcher.any
โ โโโ dispatcher.conf
โโโ playbook.yml
โโโ services
โ โโโ aem-author.service
โ โโโ aem-publish.service
โ โโโ tailon.service
โโโ user-provided
โ โโโ cq-quickstart-6.4.0.jar
โ โโโ dispatcher-apache2.4-4.2.3.so
โ โโโ license.properties
โโโ vm
-
Tell Ansible where your file names
open
playbook.yml
and edit the variablesaem_jar_name
anddispatcher_module_name
** (documentation in the file) -
Run VM
On Mac? use
./vm up
. see the VM script below.Not on Mac? run
vagrant up
This VM binds no non-standard ports (46##), see Default Ports below. This can be changed: read Configuration section below.
HELP: If you have experience converting bash scripts to windows, I could use the help to convert
vm
script. -
buy me coffee? JK, just star the repo :)
NOTE: you will need to setup replication agents and configs as needed. This setup only installs AEM.
Configuration
Port forwarding
ie. Changing
localhost
ports
You can do this in the Vagrantfile
. There is a port forwarding
. You may se entries like:
# Ports Forwarding
config.vm.network "forwarded_port", guest: 4602, host: 4602
config.vm.network "forwarded_port", guest: 4603, host: 4603
config.vm.network "forwarded_port", guest: 80, host: 4604
config.vm.network "forwarded_port", guest: 8080, host: 4605
leave guest
ports untouched, and change host
ports to your heart's content!
Runmodes
in playbook.yml
you can change values for aem_publish_runmodes
and aem_author_runmodes
Dispatcher Configuration
Dispatcher will be installed with default configs.
Editing dispatcher configs
- Edit
dispatcher.any
at path:dispatcher/dispatcher.any
- Edit dispatcher
conf
at path:dospatcher/00-dispatcher.conf
applying dispatcher changes
...after the VM has been created.
Once done with your changes, you can apply them with the provision command:
ANSIBLE_ARGS='--tags "aem_dispatcher"' vagrant provision
this wont work on windows, you'd have to run
vagrant provision
to re-provision the whole VM. Unless you know how to pass env variables :)
Increase VM memory and CPU cores
in vagrantfile
change vb.memory
and vb.cpu
JVM/AEM parameters
You can set Java and AEM params in Environment
directive in services/aem-author.service
and services/aem-publish.service
Ansible extra arguments (Mac/Linux only)
You can pass extra arguments to Ansible as part of the vagrant provision
command by setting the params to the environment variable ANSIBLE_ARGS
.
HELP: need to know how to do this on windows.
for example:
ANSIBLE_ARGS='--tags "aem_dispatcher"' vagrant provision
passes --tags "aem_dispatcher"
to ansible, to run tasks with tag aem_dispatcher
Default Ports
Instance | Port on host | Port on guest (CentOs VM) |
---|---|---|
Author | 4602 | 4602 |
Publish | 4603 | 4603 |
Dispatcher | 4604 | 80 |
Tailon | 4605 | 8080 |
SSH into VM
Use vagrant ssh
while on the root of this project directory.
This allows you to SSH with the key vagrant generated when it setup the VM.
Logs
Go to localhost:4605
to see logs reported by tailon
Please note tailon has a bug with regards to showing the full path of the log in the web UI. I opened a PR to fix it. It should still allow you se all the logs with no issues.
You can also SSH into VM as mentioned above to see logs.
Instance | Log Location in the VM |
---|---|
Author | /home/vagrant/aem-author/crx_quickstart/logs |
Publish | /home/vagrant/aem-publish/crx_quickstart/logs |
Dispatcher | /etc/httpd/logs |
VM script (Mac/Linux* only)
*Must support bash
run ./vm help
or look into the vm
file, I added a LOT of documentation :).