Skip to content

How to Boot an EC2 with a WebServer Setup

Create a new AWS EC2 instance, and set the User Script to the following:

#!/bin/bash sudo su yum update -y yum install -y httpd.x86_64 systemctl start httpd.service systemctl enable httpd.service echo "<h1>Serving from $(hostname -f)</h1>" > /var/www/html/index.html
Code language: Bash (bash)

See also  How to setup the AWS CLI for multiple profiles
Tags:
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x