Demonstrating Application Tier(Middle Tier)- AWS(Amazon Web Services)

BySai Charan Paloju

Nov 23, 2022 #AmazonEC2Components, #AmazonEC2InstanceTypes, #AmazonElasticBlockStorage-EBS, #AmazonElasticFileSystem-EFS, #AmazonMachineImages(AMI), #AmazonS3WebHosting, #AmazonSimpleStorageService-S3, #ApplicationLoadBalancer, #AttachLoadBalancertoAutoScaling, #AutoScalingGroups, #AWS Command Line Interface, #AWS Curriculum, #AWS Database Management, #AWS High Availability, #AWS Monitoring, #AWS Networking, #AWS Server Management, #AWS Storage Management, #AWSAvailabilityZones, #AWSCLIConfigurations, #AWSCLIFeatures, #AWSCommandLineInterface, #AWSDatabaseManagement, #AWSHighAvailability, #AWSInternetGateway, #AWSManagementConsole, #AWSMonitoring, #AWSNetworking, #AWSRegions, #AWSServerManagement, #AWSStorageManagement, #Backups-SNAPSHOTS, #Cloud Concepts, #Cloud DevOps Engineer Course, #CloudConcepts, #CloudProviders-AWSvsAZUREvsGCP, #CloudwatchAlarms, #CloudwatchDashboards, #ConfigureAWSCLI, #ConfigureEmailForHighCPUUsage, #ConfiguringFirewallsForEFSAccess, #CreatePAASMySQLDatabase, #CreatingaCustomVPCUsingAWSCLI, #CreatingDownScalePolicy, #CreatingUpScalePolicy, #CustomAmazonMachineImages, #Database&Tables, #DatabaseConcepts, #DefinethebenefitsoftheAWScloudincluding, #DeployingWebApplicationsOnEC2Instance, #DesigningCustomVPC-ClientRequirement, #DesigningHighlyAvailableVPC, #DesktopsvsServers, #EBSADDITIONALVolume, #EBSROOTVolume, #EBSVolumeTypes, #EBSvsEFSvsS3, #EC2IPAddressTypesPublicvsPrivatevsElastic, #Elasticity, #FundamentsofCloudComputing, #HighAvailability, #IAASvsPAASvsSAAS-CloudOfferings, #IAMOverview, #IAMPolicies, #IAMUsers, #ImplementingApplicationLoadBalancer, #InfrastructureAsAService(IAAS), #InstallAWSCLIonCentOS, #IntroductiontoLoadBalancing, #IntroductiontoScalability, #LaunchConfigurations, #LogicalDataCenters, #Monitoring-Cloudwatch, #NetworkingBasics-Protocol-Port-Firewall, #Pay-as-yougopricing, #PlatformAsAService(PAAS), #ProvisionEFSFileSystem, #RelationalDatabaseService(RDS)-Features, #Reliability, #sai charan paloju, #Scalability, #Security, #SetupJavaWebApplication-PAASMySQL, #SharedFileAccessacrossMultipleInstances, #SharesFileAccessacrossMultipleAvailabilityZones, #SimpleNotificationService-SNS, #smart cherrys tech, #smart cherrys thoughts, #SoftwareAsAService(SAAS), #SSHSoftware's-GitBash&Putty&Terminal, #TakeEC2ActionUsing-CloudWatch, #TraditionalNetworkingComponents, #UnderstandingCLIReference, #UnderstandingDefaultVPC, #UnderstandingRequirementsFromClient, #VPCNACL's, #VPCPublicSubnets, #VPCRouteTables, #VPCSecurityGroups, #VPCSubnetting, #WalkthroughAWSFreeTierAccount, #WorkwithSSHKeyPairs

Demonstrating Application Tier(Middle Tier)- AWS(Amazon Web Services)- In this tier, info collected in the front end(Presentation Tier or User Interface) is processed sometimes against other information in the data tier.

In this tier -Using business logic, a specific set of business rules.

This Application Tier Environment can be PHP, PYTHON, JAVA etc.

Application Runtime- In basic terms, the application runtime environment is a configuration
of hardware(EC2) and software(PHP/Python/Java etc) necessary for
that application code to execute.

The application tier, also known as the logic tier or middle tier, is the heart of the application.

In this tier, information collected from the presentation tier is processed – sometimes against other information in the data tier

The application tier is typically developed using Java, Python, PHP etc So based on the application you are working with, let say

■ For PHP Application, we need PHP Runtime

■ For Python Application, we need Python Runtime

■ For Java Application, we need Java Runtime

Demonstrating the Application Tier (PHP APP Example)-

PHP is a general-purpose scripting language geared toward web development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1993 and released in 1995. The PHP reference implementation is now produced by The PHP Group

  1. Create EC2 With Amazon Linux OS
  2. Connect Ec2 Instance with SSH Client Software(Gitbash

In Gitbash Type Sudo mkdir /opt/(give any name for directory), we are creating new directory in opt directory

2. Type yum -y install httpd, this is to Install Apache Http Server software here

3. Type sudo systemctl status httpd, to confirm Apache server software is installed or not

4. Type sudo systemctl enable httpd, this is to enable Apache Server software Automatically whenever we start EC2 instance 

5. Type sudo systemctl start httpd, this command is to start Apache http server

6. Type sudo systemctl status httpd, this command is to check the status of Apache server on EC2 Intance

7. Open EC2 Instance on AWS and Select Your EC2 Instance & Copy IPv4 Address

8. Paste on New Tab And Click Enter, You’ll See the test page of the Apache server, which means there is no content at /var/www/html

9. Type sudo vi /var/www/html/date.php, this command is to Create Text file on document root

10. Click i, To Enter into INSERT MODE

11. Open w3schools.com/php/php_date.asp

on this website we are take sample PHP App code

12.  Click on Try it Yourself

13. Select the code on the left hand side

14. Right Click and Copy It

15. Paste the copy on Gitbash 

16. Click ESC to come out of Insert mode,

Type :wq, this command is to Save & Quit the text file.

The Text file date.php  is Created

17. open Browser

18. Open AWS, Copy the IPv4 Addess of EC2 Instance

19. Paste Ipv4 Address/date.php, date.php is php app file we created

Here in this page we got the output but the date and time is not showing, our goal is to pull todays date from our local computer.Lets see how we can do it.

20. Type sudo yum -y install php, this command is to install php software EC2 Instance, amazon linux that we put on the ec2 instance does not php, so we are installing it manually.

21. Type yum list installed | grep php, this command is to check php installation status,

now its installed perfectly

22. Type sudo system ctl restart httpd, this command is to restart our Apache server

23. now go browser, click refresh, you’ll see todays date and day

thats it, PHP App is working

Demonstrating the Application Tier (PYTHON APP Example)-

Python is a high-level, general-purpose programming language. Its design philosophy emphasizes code readability with the use of significant indentation. Python is dynamically-typed and garbage-collected. It supports multiple programming paradigms, including structured, object-oriented and functional programming

1.Open Google, Type Python program add two numbers

we are searching for Sample Python App code

2. Select the First Link

3. Copy the Example Code

4. On Gitbash Type sudo vi app.py, This Command is to create NEW TEXT FILE

app.py is the name of the text file, vi is the text editor

5. Click i, To Enter into INSERT Mode

6. Paste the Code here

7. Type :wq, This Command is to save the Text file

File Is Created

8. Run The File with python app.py Command

You Can See The Output, The Python App Code Executed and Given The Output, the sum of 1.5 and 6.3 is 7.8

Python App is working

Demonstrating the Application Tier (JAVA APP Example)-

Java is a high-level, class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible.

1.Open google, Search for java program add two numbers

2. Click on Java Program to Add Two Intergers – Programiz

3. Copy The Example Code

4. On Gitbash Type sudo vi main.java

This command is to create a Text file with name of main.java

5. Click i,

To Enter to INSERT MODE

6. Paste The Code Here

7. Type :wq

This Command is Save & Quit the Text File

main.java file is created

8. Type sudo yum list installed | grep java

this command is to check whether java software on EC2 instance is there or not

it shows there is no packages, which means not java software is not there

9. Type sudo yum -y install java-1.8*

This command is Install Java Software on EC2 Instance

10. Type sudo javac main.java

this command is to run text file we created with the name main.java

we are running the java file

11. Type java Main

This is Application name

We got the output, Enter two number 10 20, The sum is:30

It worked.

Java App is working.

Try putting java app on document root

Type ls

this command is to check the files in directory

Type sudo cp main.java /var/www/html

This command is to copy main.java file in /var/www/html

which is document root

main.java file is copied to /var/www/html

Type ls /var/www/html

to check the files in /var/www/html

we can see main.java is copied

Copy IPv4 Address 

put IPV4 Address/main.java

Click enter and check

It is showing the same program, it will not get executed because its stand alone program

if you have any doubts, comment below

By Sai Charan Paloju

Trained AWS Certified Solutions Architect Associate Course SAA-C02/Content Writer/Creator, Masters Degree- Software Engineering, Bachelors Degree- Computer Science & Engineering, Youtuber- Host/Interviewer/Content Creator/Video Editor, Podcaster- Host/Interviewer/Content Creator/Editor, Technical Writer, Social Media Manager/Influencer Ex-Professional Cricketer mailme@smartcherrysthoughts.com https://smartcherrysthoughts.com/

4 thoughts on “Demonstrating Application Tier(Middle Tier)- AWS(Amazon Web Services)”

Leave a Reply

Your email address will not be published. Required fields are marked *