Wednesday, 9 March 2016

Setting up an AEM server from scratch - Part 1

As an Architect you will be expected to setup AEM servers from time to time on existing hardware. In some cases, when you are in the Cloud, the domain architects will want to scale your existing environment, and you (as AEM Architect) will need to reconfigure the Sling Mappings to point to the new Publish Servers. 

This might seem like a daunting task, but in fact, is not that hard. Think of it like building Lego - you have bought a new set and you have to build it according to the instruction booklet. If you follow the steps one by one, you will get a nice model, but if you start building from the middle and jump around, it becomes much more difficult.

The same applies with AEM, its a prescribed step by step setup. If you follow that, and with some knowledge and understanding, you will have a good AEM environment. (I'm avoiding the word "perfect" as no system will ever be perfect.. in my opinion).

Ok, let's dive into the fun stuff and get our hands dirty! 

Scenario: You were asked by your company to create a brand new AEM setup on the new VM's that were setup by the domain architects. 

Note: The following is not compulsory to know very well, usually the domain architects will install AEM for you and you need to configure the setup of  AEM and transfer all the content from one server to another. 

A Typical Adobe AEM environment:



For the following sections, you need the following, and advanced knowledge of AEM:

  • Packages / Backups of previous installations, DAM and user groups, etc.
  • Access to a JumpHost* (JH from hereon) - from where you can access the Publish servers.
  • Software like mRemoteG installed on the JumpHost.
  • Access details for the remote sessions.
  • Full Admin rights on the Author servers as well as the Publish Servers. 
  • Knowledge of the Inner workings of AEM.
  • Knowledge of Sling Mappings, Replication Agents, etc.

Installing AEM on both the Author server and the Publish Servers

If you are on a Mac, ask the domain architects to create JumpHosts for the Author instance and the Publish instances. This will make the following tasks a bit easier.
(Actually, even if you are on a PC, request to have JumpHosts for the Author AND Publish instances.)

Author

  • Open your JH connection. (Mac: Microsoft Remote Desktop | PC: Remote Desktop)
  • On the JH, open command prompt / terminal and browse to the installation file of AEM. (The .JAR file)
  • Type in the following for the author instance: java -XX:MaxPermSize=256m -Xmx1024M -jar cq5-author-p4502.jar and hit enter. 
  • Side note, for debugging purposes type the following: java -Xms1024m -Xmx2024m -XX:MaxPermSize=256M  -agentlib:jdwp=transport=dt_socket,address=30303,server=y,suspend=n -jar cq-author-4502.jar -gui
  • When the instance has started up, login with your admin credentials
  • Go to the Package Manager: http://<SERVERNAME>:<PORT #>/crx/packmgr/index.jsp 
  • Note: If there is an active author instance, you should inform all authors that the system will be 'down' for one day. In this time you will make backups / packages of all the data.
  • Install any packages / backups from the previous system that are needed (if applicable). 
  • Once you have installed the author instance, you can move on to the Publish Servers. 

Publish

  • Again, connect with JH to the Publish Servers. 
  • Open Terminal / Command Prompt and type the following: java -XX:MaxPermSize=256m -Xmx1024M -jar cq5-author-p4502.jar, nosamplecontent
  • Its very important to add the 'nosamplecontent' to your string, as this is for security on the Publish Servers and also, as the word suggests, does not install the Geomatrixx components.
  • Note: The next few steps are optional, depending on your setup.
  • While the 'old' Publish Servers are still running, create backups / packages from the server and install these on the new Publish Server. 
  • Make sure that you also copy over the user groups / OSGI Bundles, etc.
A side noteIf you create a server from scratch, you will obviously not have any backup packages to install, in this case you can just skip to the Replication setups.

Below are a couple screenshots to help with the upload of packages: 

Sign in to your AEM instance



Click top left logo and then CRXDE Lite




Click on the Package Manager Icon and upload your backups / packages



Ok, its time for some coffee.. when you are back, we will then setup the sling mappings on the publish server and also setup the Replication Agents. 

See you in Part 2 :).

No comments:

Post a Comment