install and configure apachi, php and mysql

 

Created by CreateImage(i-0aea0f98ea25af287) for ami-09ead4d4b48aa6f63 from vol-0ac38294d82ae8f4a

Amazon Linux 2 AMI (HVM), SSD Volume Type - ami-009d6802948d06e52

 

#!/bin/bash

yum update -y
yum install httpd -y

systemctl start httpd.service
systemctl enable httpd.service

########################################

aws s3 ls # after assigning S3 IAM role to EC2 instance. 

aws s3 cp s3://YOURBUCKETNAMEHERE/index.html /var/www/html/ # only good for Virginia

aws s3 cp s3://YOURBUCKETNAMEHERE/index.html /var/www/html/ --region

 

aws s3 cp --recursive s3://bucketname /home/ec2-user/dest #will work for most Regions such as for virginia
aws s3 cp --recursive s3://bucketname /home/ec2-user/dest --region <region_name> # for all regions.

######################################

#!/bin/bash

yum install httpd php php-mysql -y

yum update -y

chkconfig httpd on

service httpd start

echo "<?php phpinfo();?>" > /var/www/html/index.php

cd /var/www/html

wget https://s3.amazonaws.com/acloudguru-production/connect.php

 

 

Add comment


Security code
Refresh

Category: