PHP代写 | COS20019 – Cloud Computing Architecture

本次澳洲IT代写PHP网站的主要内容是使用aws和php完成web开发

Assignment 1 – part A

Creating and deploying a simple web page

Due Date: 30 March 9 am. Submission to Canvas

Contribution to final assessment: 5%, graded as pass/fail. Before you start this Assignment

Make sure you have completed ACF Labs 3.
You will also need to create your own key pair and be able to access your EC2 instance via SSH using utilities like PuTTY and/or WinSCP. See the notes on Remote Access to your EC2 Instance on Canvas.

Objectives

This assignment has the following objectives:

  1. Get familiar with the AWS management console.
  2. Launch your own EC2 instance.
  3. Deploy your first PHP web page (PhotoAlbum) on Apache web server on your EC2 instance.

Note: In this introductory assignment you will create an EC2 Web server in the Default VPC. In general the default VPC is suitable only for experimental / toy deployments, and it use is considered bad practice for production resources.
In the next assignment you will create your own secure VPC.

Task 1 – Launch your own Linux EC2 instance

Before launching an EC2 instance, a key pair is required for logging in to your instance in the future, follow the ‘AWS Remote Access Tutorial’ on how to create one. Then launch an EC2 instance from the AWS management console in us-east-1 region. It must have the following properties:

– Amazon Machine Image: Amazon Linux 2 AMI (HVM), SSD Volume Type
– Instance type: t2.micro
– Advanced Details – User data: enter the following script to automatically set up the Apache

server at launch (a copy is on Canvas under the Assignment Resources):

#!/bin/bash

sudo yum update -y

sudo amazon-linux-extras install -y lamp-mariadb10.2-php7.2 php7.2

cat /etc/system-release

sudo yum install -y httpd mariadb-server

yum info package_name

sudo systemctl start httpd

sudo systemctl enable httpd

sudo systemctl is-enabled httpd

sudo usermod -a -G apache ec2-user

sudo chown -R ec2-user:apache /var/www

sudo chmod 2775 /var/www && find /var/www -type d -exec sudo chmod

2775 {} \;

find /var/www -type f -exec sudo chmod 0664 {} \;

echo “<?php phpinfo(); ?>” > /var/www/html/phpinfo.php

– New security group named “WebServer-SG” that allows only necessary traffic types (SSH, HTTP, HTTPS) to reach the instance from anywhere. Do not allow every traffic types.

Other configurations should be left as default such as default Virtual Private Cloud (VPC), default subnet, etc.
Allow a few minutes for the instance to launch and execute the commands in the above script, the Instance State and Status Check should change to ‘running’ and ‘2/2 checks passed’, respectively. After that, visit http://your.public.dns.amazonaws.com/phpinfo.php, if you see a welcome page, that means the EC2 instance and Apache server have been installed correctly.

Note: Due to the pay-as-you-go pricing approach, the longer your instances run the more you pay; therefore, you are advised to stop the instances after each working session.

Task 2 – Create a PHP web page (PhotoAlbum)

Create a PHP web page (upload.php) with the functionality as visualised as below. Feel free to individualise you web page as you wish.

Figure 2 – Photo uploader page (upload.php)

The Photo Album link at the bottom of the page should link to a web page called getphotos.php. For this part of Assignment 1 a all this page needs to do is display a simple photo. For assignment 1 b you need to add the search functionality.

The directory structure of your website is described below. You can create additional HTML, CSS, JavaScript files if needed. The Apache HTTP server serves files located in a directory called Apache document root (/var/www/html); thus the COS20019 folder must be in the Apache document root folder. Follow the ‘AWS Remote Access Tutorial’ to learn how to transfer files to the Linux EC2 instance.