Webserver Implementation
$ cd ~/Downloads $ mkdir SSH $ mv MyEC2KeyPair.pem SSH $ cd SSH $ chmod 400 MyEC2KeyPair.pem$ ssh ec2-user@${ec2_public_ip} -i MyEC2KeyPair.pem$ sudo su $ yum update -y $ yum install httpd -y$ cd /var/www/html/ $ vim index.html $ service httpd start$ chkconfig httpd on#!/bin/bash yum install httpd -y yum update -y echo "<html><body>Hi, this is a webserver.</body></html>" > /var/www/html/index.html service httpd start chkconfig httpd on#!/bin/bash yum update -y yum install httpd -y aws s3 cp s3://${bucket_name}/${directory} /var/www/html --recursive service httpd start chkconfig httpd on
Last updated