How to Create Web Server Instance on AWS EC2 - 2024

Опубликовано: 17 Октябрь 2024
на канале: Henri Studio
138
3

In this video, we will launch or create web server instance on aws ec2 service. we also installed web application for load test our web server.

Code used :
===============================================
#!/bin/sh

#Install a LAMP stack
dnf install -y httpd wget php-fpm php-mysqli php-json php php-devel
dnf install -y mariadb105-server
dnf install -y httpd php-mbstring

#Start the web server
chkconfig httpd on
systemctl start httpd

#Install the web pages for our lab
if [ ! -f /var/www/html/immersion-day-app-php7.zip ]; then
cd /var/www/html
wget -O 'immersion-day-app-php7.zip' 'https://static.us-east-1.prod.worksho...
unzip immersion-day-app-php7.zip
fi

#Install the AWS SDK for PHP
if [ ! -f /var/www/html/aws.zip ]; then
cd /var/www/html
mkdir vendor
cd vendor
wget https://docs.aws.amazon.com/aws-sdk-p...
unzip aws.zip
fi

Update existing packages
dnf update -y

============================================