Lets install below SWs in PC and set up the environment to implement web app.
1. JDK:14.0.2
2.Eclipse for J2EE
3.Tomcat :9.0.36
4.Once JDK and eclipse setup done , install the AWS tool kit as below
- Open Help → Install New Software….
- Enter https://aws.amazon.com/eclipse in the text box labeled “Work with” at the top of the dialog.
- Select the required "AWS Core Management Tools" and other optional items from the list below.
- Click “Next.” Eclipse guides you through the remaining installation steps.,Note: The toolkit requires Eclipse 4.4
Crete new Dynamic web project in eclipse
Give name to the project:
click "Finish", eclipse will automatically creates a project for you.
Create a login.jsp under "Web content" directory as below.
To test this app, we need web server to be setup in machine.
To add the tomcat server, setup as below
Click on create new server.
provide Tomcat folder as below
Select your web and add to the right
To run web app , you need to select as below
before this step, first start the Tomcat server as below
Once server starts, you can select your app and run .
Once you run successfully , you can see the below page.
The same web application we will deploy to AWS using service called "Elastic beanstalk".
When we use this service , AWS automatically manages the required environment for the web application.
Since we required IAM user and credentials to setup the access , its a long process to demonstrate.
Let me use Root access and get the access key and security credentials .
Go to "Access Key" as below
Click on "create New access key"
Now you have to configure AWS security keys as below
Click on Preferences in eclipse as below
Add secret key and Access key as below
Creating a server in eclipse for tomcat as below
Then add "region" and web app name like below
Click "next"
click next and add your app as below
Now you can see two servers as below
In case it gives the error while deploying and running the application,
you have to try running after few minutes later.
The error might come because if you are running the application first time, AWS might be creating the platform required for this and it might be timing out.
To check the status of what AWS is doing when you run the application from Eclipse, go to the AWS console --> Elastic Beanstalk service.
We would see your web application being created there. and it might be creating the environment needed for that.
we can also see the steps performed by AWS in Your Application --> Your environment --> Events section as below.
To access the application you just deployed on AWS, Click on your environment and you would see the link there.
You should be able to access your application using that URL.
we can also see the steps performed by AWS in Your Application --> Your environment --> Events section as below.
To access the application you just deployed on AWS, Click on your environment and you would see the link there.
You should be able to access your application using that URL.
Hope it is east to deploy your simple web app to AWS premises using Elastic beanstalk.
Thank you for reading !!!!
No comments:
Post a Comment