Skip to content

Instantly share code, notes, and snippets.

@phillippbertram
Last active September 5, 2021 18:18
Show Gist options
  • Save phillippbertram/68ac80193fbcb80d21a8ca0e2ee48625 to your computer and use it in GitHub Desktop.
Save phillippbertram/68ac80193fbcb80d21a8ca0e2ee48625 to your computer and use it in GitHub Desktop.
Simple httpd server user data script for ec2 instances that shows the current host name
#!/bin/bash
# use this for the user data
yum update -y
yum install -y httpd
systemctl start httpd
systemctl enable httpd
echo "<h1>Hello from $(hostname -f)</h1>" > /var/www/html/index.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment