I'm trying to create a web project that is able to communicate with Amazon RDS. I know how to make a localhost project connect to a RDS with JDBC.
However, the problem is that I never tried to deploy my project (so that, for example someone can type somePage.com
, and go to my webpage).
I have an Amazon EC2 instance, and I've already written a simple hello world jsp page. I am able to compile it and run the Eclipse Web Dynamic Project using the installed Apache Tomcat Server, and then typing localhost:8080/somePage
then I can see my hello world popping up.
However, how do I deploy my project on this EC2 instance? I'm using Windows Server 2012 edition.
My whole idea is that once I have one AMI image all setup, then I can just use autoscale to scale my webpage with that AMI image.
Can anyone point me to the right direction?
Follow the steps below:
apache-tomcat-folder\bin\startup.bat
. (You can also donwload an installer and set it up as windows service. Check this link for more details).http://yourinstaceaddress.com:8080/
)..war
file.war
file name and folder to export. More detailed explanation can be found here and here (with pictures)..war
file to your Tomcat Server.war
(saymyapp.war
) file in yourapache-tomcat-folder\webapps\
folder..war
's name wasmyapp.war
. You should visithttp://yourinstaceaddress.com:8080/myapp
That's it. If you ever edit the app, repeat steps 2-4 (but delete the
webapps\myapp\
folder created before executing step 3).Boxfuse does exactly what you want.
For you Java web application you literally only have to execute:
This will
Any subsequent update will be done as a zero downtime blue/green deployment.
For your domain, you can simply map your samepage.com DNS record to the CNAME of the ELB.
More info: https://boxfuse.com/blog/auto-scaling