Share via


ARM template for LAP (Linux + Apache + Php) and Neo4j Deployment

Just finished writing my first ARM template that can deploy a set of VMs, where in one VM has an Apache and php installed with a sample website, and another VM with an installation of Neo4j which is accessible only to the first VM on a private port. The Sample website in the Apache node can echo out a message if it could get connected successfully.

The repo is yet to be merged with the Azure repo, but for now one can find it here  https://github.com/brijrajsingh/azure-quickstart-templates/tree/master/101-lap-neo4j-ubuntu.

Lets discuss the construct of our ARM template, This is the folder structure of our ARM template

[caption id="attachment_67" align="alignnone" width="467"]ARM Template folder structure ARM Template folder structure[/caption]

 

azuredeploy.json, azuredeploy.parameters.json, metadata.json and README.md are mandatory file for any template to be a valid ARM template, you can find the rules in the github repo here https://github.com/Azure/azure-quickstart-templates#readmemd.

The installation of Apache, PHP and code to check connectivity as well as installation of Neo4J is done by the custom script extensions.

install-lap.sh - is the script to

  • Install Apache
  • Install php5
  • Install Composer - Globally
  • Write a Info.php file - to emit phpinfo()
  • Write a file neo4jtest.php - which echo out 'connected successfully' if it can connect to the Neo4J VM on a static IP - 10.0.0.10

install-neo4j.sh - is the script to

  • Add Neo4J to the packages source list
  • Update apt-get
  • Install Java 8 (Silently) - Neo4J needs JDK or JRE - as in Neo4J(J is Java)
  • Install Neo4j
  • Enable remote connectivity to Neo4J and restart Neo4j