Skip to content

Instantly share code, notes, and snippets.

@girisagar46
Created August 17, 2020 15:49
Show Gist options
  • Select an option

  • Save girisagar46/7f3cb036810f22514463f8de8fdca675 to your computer and use it in GitHub Desktop.

Select an option

Save girisagar46/7f3cb036810f22514463f8de8fdca675 to your computer and use it in GitHub Desktop.
Simple ec2-userdata for apache server
#!/bin/bash
# Use this for your user data (script from top to bottom)
# install httpd (Linux 2 version)
yum update -y
yum install -y httpd
systemctl start httpd
systemctl enable httpd
echo "<h1>Hello World 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