0% found this document useful (0 votes)
22 views

Practical 6 1

Uploaded by

Mr Banna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Practical 6 1

Uploaded by

Mr Banna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

20012011055 CEIT: D-AB14 Dhruv.S.

Lakhani
-------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------

[ 2CEIT603: CLOUD COMPUTING]


Practical: 6

AIM- AWS-EC2

Submitted by : Dhruv.S.Lakhani
Enrollment number : 20012011055

Department of Computer
Engineering/Information Technology
20012011055 CEIT: D-AB14 Dhruv.S.Lakhani
-------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------

Practical-6
AIM- Amazon EC2 Configuration.

a. Host a website on Linux EC2 instance.


b. Host a website on Windows EC2 instance.
Steps for creating and launching the Linux instance
Step-1: Selecting the nearest server so that our application will work faster and
more efficiently

Step-2: Click on Services section under which all the services are listed provided by the AWS.
Since we want to use the EC2 service we will click on it.

1|Page
20012011055 CEIT: D-AB14 Dhruv.S.Lakhani
-------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------

Step-3: From the console dashboard, choose Launch Instance.

Step-4: Here, first we give a name to the instance we will launch.

Step-5: Then choose an Amazon Machine Image (AMI) page that displays a list of basic
configurations, called Amazon Machine Images(AMIs), that serve as templates for your
instance. Select an HVM version of Amazon Linux 2.

2|Page
20012011055 CEIT: D-AB14 Dhruv.S.Lakhani
-------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------

Step-6: Now we can select the hardware configuration of your instance. Select the
t2.micro instance type

Step-7: Now we select a key pair. We can create a new key pair. But here we have already
created one so we choose the existing key pair.

3|Page
20012011055 CEIT: D-AB14 Dhruv.S.Lakhani
-------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------

Step-8: Under Security Groups, you'll see that the wizard created and selected a security
group for us.
Here we will create two more security groups

Step-9: Add storage

4|Page
20012011055 CEIT: D-AB14 Dhruv.S.Lakhani
-------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------

Step-10: Now click on the launch instance.

Step-11: A confirmation page lets you know that your instance is launching. Choose View
Instances to close the confirmation page and return to the console.

5|Page
20012011055 CEIT: D-AB14 Dhruv.S.Lakhani
-------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------

Step-12: Now go to your instances and click on the instance ID you want to connect to.

Step-13: Now click on connect.

Step-14: We will go with the default username. And then click on connect.

6|Page
20012011055 CEIT: D-AB14 Dhruv.S.Lakhani
-------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------

As we can see, the Linux terminal has opened.

Step-15: Here Then we will update our Ubuntu server:


- sudo apt update

7|Page
20012011055 CEIT: D-AB14 Dhruv.S.Lakhani
-------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------

Step-16: Installing apache2 server:


- sudo apt install apache2

Step-17: Installing mysql server :


- sudo apt install mysql-server

Step-18: Installing all necessary php library and php mysql driver :
- sudo apt install php libapache2-mod-php php-mysql

Step-19: Now we will make the priority of index.php page by editing in swapping index.html
and index.php:
- Nano /etc/apache2/mods-enabled/dir.conf

Step-20: Now we will create a file in which all the detail of database connection is
written:

8|Page
20012011055 CEIT: D-AB14 Dhruv.S.Lakhani
-------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------

- cd /var/www
- mkdir inc

Step-21: Now we will create small website to host it:


- cd /var/www/html
- nano SamplePage.php

Press ctr+x to save and exit


Step-22: Now close the terminal and restart again then do followingsteps:
Open mysql using sudo su command and enter password as blankand write the query:
- Sudo mysql
- ALTER USER ‘root’@’localhost’ IDENTIFIED WITH
MYSQL_NATIVE_PASSWORD by ‘root’;

9|Page
20012011055 CEIT: D-AB14 Dhruv.S.Lakhani
-------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------

This will make the password of root as root.

Step-23: Create database ‘cc_practical’:

Step-24: Now start apache2 and MySQL server:

Now open browser and write the url


‘ip’/SamplePage.php
10 | P a g e
20012011055 CEIT: D-AB14 Dhruv.S.Lakhani
-------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------

Here it is: http://13.232.130.37/SamplePage.php

11 | P a g e
20012011055 CEIT: D-AB14 Dhruv.S.Lakhani
-------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------

AWS Documentation
Windows Installation guide
1. Sign in to the AWS Management Console: Go to the AWS Management Console and sign in
with your AWS account credentials.

2. Choose EC2 from the services menu: Once you're signed in, select "EC2" from the services
menu to go to the EC2 dashboard.

12 | P a g e
20012011055 CEIT: D-AB14 Dhruv.S.Lakhani
-------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------

3. Launch an instance: Select “Instance” from the side navbar and Click the "Launch Instance"
button to start the process of launching a new instance.

4. Choose AMI: In the "Choose an Amazon Machine Image (AMI)" page, select the Windows
Server AMI that you want to use for your instance. You can select an AMI based on the version
of Windows Server that you want to use, the region where you want to launch your instance, and
other criteria.

13 | P a g e
20012011055 CEIT: D-AB14 Dhruv.S.Lakhani
-------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------

5. Choose instance type: Select the instance type that meets your needs. You can choose from a
variety of instance types based on factors like the amount of CPU, memory, and storage capacity
you need.

14 | P a g e
20012011055 CEIT: D-AB14 Dhruv.S.Lakhani
-------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------

6. Create or choose key pair: If you haven't already created a key pair, you'll need to do so now.
This is used to securely log in to your instance over SSH. Alternatively, you can choose an
existing key pair. Generate a Key pair which will provides a secure way to connect to your
instance over SSH, and it ensures that only authorized users can access your instance.

7. Configure security group: Configure the security group for your instance. This is where you
define the inbound and outbound traffic rules for your instance.

8. Add storage: Add storage volumes to your instance as needed. You can choose from different
types of storage options, including Amazon Elastic Block Store (EBS) volumes and instance
store volumes.
15 | P a g e
20012011055 CEIT: D-AB14 Dhruv.S.Lakhani
-------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------

9. Summary: Summarize the details of your instance, make any necessary changes, and then
click "Launch instance" to start the process of launching your instance.

10. Launch instance: Finally, click "Launch Instances" to launch your Windows instance. You
can monitor the progress of the launch process on the "Instances" page of the EC2 console.

16 | P a g e
20012011055 CEIT: D-AB14 Dhruv.S.Lakhani
-------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------

Successfully installed Windows Instance

17 | P a g e
20012011055 CEIT: D-AB14 Dhruv.S.Lakhani
-------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------

For launching the Windows Instance steps are as follows:

1. Wait till the instance state is shows a “Running” status along with status check to “2/2 checks
passed”.
When you see a "2/2 checks passed" status for an instance, it means that both system status
checks and instance status checks have passed successfully. This indicates that your instance is
fully operational and ready to use.

18 | P a g e
20012011055 CEIT: D-AB14 Dhruv.S.Lakhani
-------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------

2. Click on Connect which will take you to the Connect instance page after which select RDP
client

3. Save the Password and Download remote desktop file and open it. Click on connect.

19 | P a g e
20012011055 CEIT: D-AB14 Dhruv.S.Lakhani
-------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------

4. Enter the credential which was saved earlier.

5. Once done it will connect you to your instance

20 | P a g e
20012011055 CEIT: D-AB14 Dhruv.S.Lakhani
-------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------

Host Website on Windows

1. Open windows instance.

2. Download and install Xampp from the official website.

21 | P a g e
20012011055 CEIT: D-AB14 Dhruv.S.Lakhani
-------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------

3. Configure the Xampp server

22 | P a g e
20012011055 CEIT: D-AB14 Dhruv.S.Lakhani
-------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------

4. Open folder where Xampp is installed.

Inside the folder open ‘htdocs’ folder.

23 | P a g e
20012011055 CEIT: D-AB14 Dhruv.S.Lakhani
-------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------

5. Copy your project file and paste onto the htdocs folder.

24 | P a g e
20012011055 CEIT: D-AB14 Dhruv.S.Lakhani
-------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------

6. Swap the name dashboard with the name you have given your project with.

7. Open Xampp server, start Apache server and MySQl.

25 | P a g e
20012011055 CEIT: D-AB14 Dhruv.S.Lakhani
-------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------

8. Click and open Admin of MySQL

26 | P a g e
20012011055 CEIT: D-AB14 Dhruv.S.Lakhani
-------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------

9. Go to new and manually create a database named “ec2”

10. Go into “ec2” database and go to import

27 | P a g e
20012011055 CEIT: D-AB14 Dhruv.S.Lakhani
-------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------

11. Go to choose file and select “survey_details.sql” and open it.

Once done it will show import has been successfully finished and will show rows.

28 | P a g e
20012011055 CEIT: D-AB14 Dhruv.S.Lakhani
-------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------

12. Open new tab and write, “localhost/dashboard” and try it with on other device with the public
IP Address.

29 | P a g e

You might also like