How to deploy your webapp on tomcat with AWS EC2 and RDS
In this blog I am going to show you we can deploy our application using Amazon Ec2 and RDS. For this we need Amazon web services Ec2 and Rds services.
Steps to deploy your application on AWS EC2 and RDS Service
Create a free tier account on aws and select region. I will follow this tutorial create account.
To run your application you required virtual machine. We can create this by using create EC2 instance.
We required relational database to connect your application.We can create this by using create RDS.Here i will select mysql database instance.
Now our both services running on aws.
Go to our application in eclipse or intellijId and convert into war or jar file. but make sure to remember edit database configuration detail as per your
RDS
before going to convert into war file.Install tomcat server on your ec2 service by using Install tomcat follow the step by step guide.
Go to root directory on ec2 instance and use command
sh startup.sh
it will run your tomcat server on ec2 on port 8080.You can access your tomcat server use public network Ip of your instance and run tomcat on your local by
http://server_ip:8080
.Deploy your application on tomcat server i.e deploy your war file on tomcat and check your database running on RDS should be connected.
And that’s it by this way we can deploy our application on
AWS CLOUD
as a infrastructure without maintaining on premises server and database.