Deploying J2EE Web Application on Amazon Web Services - amazon-web-services

I had been working on amazon web services from couple of days and it is giving me a hard time. All the want it to deploy my J2ee web application on Amazon web Services. I had used the following approach:
1) In had installed the AWS toolkit on eclipse.
2) I had deployed the sample web application of the amazon web services but it is without database. It's a static web page.
But i want to deploy my j2ee web application on aws with apache tomcat 7 as server and mysql database server. Can any one explain me how to deploy the j2ee web app on the aws? I would be highly thankful to you.

I would suggest you try AWS Elastic Beanstalk
If you use tomcat with your Java EE application, it become easier because it already have some templates for that. Creating and Deploying Elastic Beanstalk Applications in Java Using AWS Toolkit for Eclipse
As for mysql, AWS also has the RDS which can do it perfectly. Just modify your database.config in your Java EE application according to this.
Hope it will help.

Related

Containerised Web Application which connects to Relational DB

Can anyone point me in the direction of some demo code/app that I can use for a demo.
The app should have the ability to connect to a relational database and ideally be able to demonstrate the persistence of having the DB.
I.e. You can save values into the DB from the web app
I'm planning to deploy this onto AWS ECS for testing, alongside RDS.
Thanks in advance
Here is an AWS tutorial that shows how to write a Java Spring Boot Web app that is deployed to Elastic Beanstalk ( Elastic Beanstalk is an AWS service that leverages Amazon EC2 and S3 and deploys, manages and scales your web applications for you. It uses managed containers that support Node. js, Java, Ruby, Docker and more) and uses RDS to store and update data.
Creating the Amazon Relational Database Service item tracker
So most of what you are looking for is there - including how to setup the RDS instance and interact with it from a web app deployed to the cloud. If you follow this step by step (there is a lot of Java code) -- you will get this Sample Web App running on the cloud and it will teach you how to interact with RDS from a web app.
Also - this covers invoking additional services such as Simple Email Service from the web app.

Deploying a web application for Selenium testing on AWS EC2

I have a web application that uses Selenium in backend to run few scripts when invoked by user. I want to deploy this web app on AWS.
Here are my findings so far:
I can have a windows EC2 instance created and then I can install tomcat, firefox and all the necessary stuff. Then using putty or any other client, I can deploy my war and start tomcat.
I can directly make use of Elastic Beanstalk and deploy my war file there itself but then, there is no windows EC2 available for beanstalk and I don't know how to install firefox there and make my application work.
What is the best way to achieve this and what steps should I follow. I want to install a specific firefox version to be able to make it run with my selenium scripts.
There are two separate things here:
Deployment of web application on AWS cloud
Run the selenium tests against your web application
According to me, you should first think of deploying a web application to AWS cloud. There are many ways by which you can get it deployed to AWS cloud with below services:
Spin a new AWS EC2 instance, install all required software and deploy the web application.
Use AWS elastic beanstalk service with either with tomcat or docker.
Use AWS ECS if you prefer docker
According to me, second option will be quick for you with tomcat environment option. If you select tomcat environment, then your platform will be Tomcat 8 Java 8 on 64bit Amazon Linux.
Now, here comes the second part. You can have below options for your browser environments.
Spin a new separate AWS EC2 instances with correct AMI and install your specific browsers on these instances.
If you prefer SaaS, then you can take a look at browserstack or SauceLabs for remote environment.
If you have CI(jenkins/travis/Circle CI), then make use of that infrastructure to luanch your tests with either option from the above.

Deploy J2EE app (running on JBoss) to AWS Elastic Beanstalk

I have a J2EE web application running on JBoss and RHEL/CentOS.
What would be the best option available in AWS to migrate my application to cloud?
Option 1: Provision EC2 instance with RHEL/CentOS and deploy JBoss and deploy application war files.
Option 2: Deploy application into Elastic Beanstalk using Docker.
Option 3: Deploy application into Elastic Beanstalk using Java.
Option 3 does not suite me as they only support Tomcat.
Option 2 may suite me if I make code changes to deploy into Docker container.
Option 1 may suite me the best, but it may not be possible to auto-scale.
Kindly advice me if my understanding is correct or not and if you have any better ideas for running J2EE application using JBoss in AWS.
Much appreciated. Thanks in advance.

Hosting web services project in Amazon

Hi We have built a java based web services project with using jboss server. How do I host this application with Amazon cloud? This web services act as back end for a mobile android app.
I am looking for PaaS option of Jboss server and Postgres database. I could create a postgres database. But could not find Jboss server.
My understanding is in PaaS, Jboss and Postgres should be able to scale up itself as per demand.
Another option provided by Amazon is EC2 as far as I have understood. But if I go with EC2, I will have install and set up jboss and postgres on my own. Then does it scale up by itself as per demand?
Please guide.
If you want to deploy your web application to AWS and ensure its scalability, you have basically two options:
EC2 instance [IaaS] - The disadvantage is, as you mentioned in your question, that you have to configure everything manually. Some external mechanism for scaling has to be used. Amazon provides its AutoScaling service which can be configured to launch new EC2 instances based on utilization or some other metric.
Elastic Beanstalk [PaaS] - This service has the auto-scaling already built in and manages the EC2 instances with your application on its own (it takes care about launching them, deploying the app etc). The disadvantage is that JBoss server is not support at the moment (you would have to switch to Tomcat).
There is a way, how to make JBoss work on Elastic Beanstalk, however. ELB has newly added the support for Docker so if you make your JBoss API run in Docker, you can deploy it to ELB and scale it without much effort and configuration.
As for the database, mentioned in your question, Amazon has plenty of choices, Postgres included, in their RDS service.

AWS Elastic Beanstalk necessary for Websites (vs. web apps)?

The documentation only refers to web applications. Do I use the Elastic Beanstalk for my website or is it strictly for web apps? I've launched an EC2 instance that is not connected to the Elastic Beanstalk, however the default instance is running in the Elastic Beanstalk environment.
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/Welcome.html
Elastic Beanstalk can be used for several type of applications:
Web App. Websites are included in "Web App" but it could be just a simple REST Api used by a mobile app and it would work as well.
Worker Application. Typically an application that would get message from a queue like SQS.
Elastic Beanstalk is a tool to help deployment of an entire infrastructure, from installing a webserver to deploy the code of the application and applying custom installation script. If you have a website using any technology supported by Elastic Beanstalk (Java, Node.js, PHP, Python, Ruby, and .NET) , I would definitely suggest that you use it as it is very simple to use and gives you a lot of advantages over a single ec2 instance.
You can read documentation for workers application here : http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features-managing-env-tiers.html
And I would suggest that you read the FAQ for more details:
http://aws.amazon.com/elasticbeanstalk/faqs/
As an example, in my company we set up beanstalk for more than 15 websites: internal Backend tool in PHP, workers to send sms or emails, website with thousands of simultaneous users. One of the important point to mention is to be able to have a new website infrastructure up in about 20 minutes (new server with all configuration and code deployed).
Hope this helped you to understand Elastic Beanstalk. Don't hesitate to ask some more question and check Stackoverflow, there is a lot of information about it.