The LAMP Installer for Oracle Classic IaaS provides a Terraform-based LAMP installation for the Oracle Cloud@Customer (OCC) & OCI-Classic (OCI-C) Oracle Cloud Infrastructure platforms.
This installer utilises the Terraform Oracle Public Cloud Provider. It consists of a set of Terraform configurations & shell scripts which are used to provision a Two-Tier LAMP Stack, and associated Management Network. The software elements of the LAMP stack are based on open source technologies.
Terraform is used to provision the cloud infrastructure and any required local resources for the LAMP Stack including:
- 3 IP Networks:
-
IP Network 1: MANAGEMENT (public)
- x1 Bastion/NAT Gateway:
- Allows SSH inbound from public internet to provision & admin the environment.
- Is configured as NAT Gateway for outbound traffic originating from private networks.
- x1 Bastion/NAT Gateway:
-
IP Network 2: DATABASE (private)
- X1 MySQL Server:
- Database server uses NAT Gateway for outbound internet access (i.e. to install packages from public repositories).
- X1 MySQL Server:
-
IP Network 3: WEB FRONT-END (public)
- X1 Web Server:
- Apache, PHP, MyPHPAdmin (connected to database server), Apache Server-Info, Apache Server-Status.
- X1 Web Server:
-
Terraform uses remote-exec
provisioner to handle the instance-level configuration for the instances to provision out the Apache, MySQL, and Internet Gateway functionality.
- Download and install Terraform (v0.11.3 or later). Follow the link for Hashicorp instructions.
- Terraform OPC provider (can be pulled automatically using
terraform init
directive once Terraform is configured).
Initialize Terraform:
$ terraform init
View what Terraform plans do before actually doing it:
$ terraform plan
Use Terraform to provision resources and stand-up application components OCI:
$ terraform apply
At this point the configuration will prompt for the following inputs before building the environment:
$ variable "ociUser"
$ #(input compute user account with compute_operations rights)
$ variable "ociPass"
$ #(input password for “ociUser”)
$ variable "idDomain"
$ #(input compute tenancy service instance id)
$ variable "apiEndpoint"
$ #(input compute tenancy rest endpoint url)
The entire build and LAMP configuration process is automated – no further input is required.
The LAMP stack will be running after the configuration is applied successfully, and the remote-exec scripts have completed. Typically, this takes around 7-9 minutes after terraform apply
.
Once completed, Terraform will output the public IP addresses of the environment:
$ Apply complete! Resources: 23 added, 0 changed, 0 destroyed.
$
$ Outputs:
$
$ Application_Instance_Private_IPs = [
$ 10.2.0.10
$ ]
$ Application_Instance_Public_IPs = [
$ 140.86.0.2
$ ]
$ Database_Instance_Private_IPs = [
$ 10.3.0.10
$ ]
$ Management_Instance_Public_IPs = [
$ 140.86.0.17
$ ]
To access MySQL admin dashboard, or any of the other web interfaces running in the stack, browse to the public IP address of the application host on port 80 - followed by any of the paths as described:
/
Provides the default Apache landing page/phpMyAdmin
Provides access to the MySQL admin tool. Log in as User: root Pass: password. It will connect automatically to the database server./server-status
Server status reports generated by Apache mod_status/server-info
Apache server configuration report
Keys are provided for simplicity only, for long running deployments it is strongly recommended that you replace the provided keys prior to deployment.
- Future: Include option to choose either IaaS or PaaS database engine at initialisation phase.