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 generated with markdown-toc
VagrantAnsibleCentOs 7vagrant image.
vagrant 2.1.5or higher Install VagrantAnsible 2.7or higher Install Ansible- AEM JAR and license.
- Latest Dispatcher module*.
*Download from PackageShare. choose
Linux x86 64bitfor example:dispatcher-apache2.4-linux-x86-64-4.2.3.tar.gz
-
Add AEM JAR, license and dispatcher module:
copy your
cq-quickstart-<version>.jar,license.propertiesanddispatcher-apache2.4-<version>.sotouser-providedfolder.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.ymland edit the variablesaem_jar_nameanddispatcher_module_name** (documentation in the file) -
Run VM
On Mac? use
./vm up. see the VM script below.Not on Mac? run
vagrant upThis 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
vmscript. -
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.
ie. Changing
localhostports
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: 4605leave guest ports untouched, and change host ports to your heart's content!
in playbook.yml you can change values for aem_publish_runmodes and aem_author_runmodes
Dispatcher will be installed with default configs.
- Edit
dispatcher.anyat path:dispatcher/dispatcher.any - Edit dispatcher
confat path:dospatcher/00-dispatcher.conf
...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 provisionthis wont work on windows, you'd have to run
vagrant provisionto re-provision the whole VM. Unless you know how to pass env variables :)
in vagrantfile change vb.memory and vb.cpu
You can set Java and AEM params in Environment directive in services/aem-author.service and services/aem-publish.service
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
| Instance | Port on host | Port on guest (CentOs VM) |
|---|---|---|
| Author | 4602 | 4602 |
| Publish | 4603 | 4603 |
| Dispatcher | 4604 | 80 |
| Tailon | 4605 | 8080 |
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.
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 |
*Must support bash
run ./vm help or look into the vm file, I added a LOT of documentation :).