Skip to content

Instantly share code, notes, and snippets.

@scalixte-mdsol
Forked from mikepfeiffer/apache2.sh
Created February 16, 2025 21:12
Show Gist options
  • Save scalixte-mdsol/fe31f9a71a63fd7cf7c34d5f05e884ec to your computer and use it in GitHub Desktop.
Save scalixte-mdsol/fe31f9a71a63fd7cf7c34d5f05e884ec to your computer and use it in GitHub Desktop.
EC2 Bootstrap Script for Apache v2
#!/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment