Skip to content

Instantly share code, notes, and snippets.

@mikepfeiffer
Created January 27, 2019 16:26
Show Gist options
  • Save mikepfeiffer/f1e2394e2952096848c496b0f86e260a to your computer and use it in GitHub Desktop.
Save mikepfeiffer/f1e2394e2952096848c496b0f86e260a to your computer and use it in GitHub Desktop.

Revisions

  1. mikepfeiffer created this gist Jan 27, 2019.
    10 changes: 10 additions & 0 deletions apache2.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    #!/bin/bash

    yum update -y
    yum install -y httpd

    instanceId=$(curl http://169.254.169.254/latest/meta-data/instance-id)
    echo "<h1>Hello World from $instanceId</h1>" > /var/www/html/index.html

    systemctl start httpd
    systemctl enable httpd