Basically, I've already written a webapp, it has hibernate with SpringMVC + Spring-security.
I have an EC2 account, my question is, when deploying it to the cloud rather than on a server locally like I do now (with RDS rather than having MySQL on localhost like I do now), should I just copy the war over onto the Tomcat installation of EC2, or do everything through Eclipse?
Is it relatively straight forward to set the new Hibernate.cfg.xml to point at a RDS rather than localhost?
At the moment I just copy the war onto the server and use iptables to map 80 to 8080, but I think I'm taking a very long route for deployment...I've not setup the db layer yet remotely...
Thanks,
I am used to deploying WAR files to EC2 instances (though using WebLogic instead of Tomcat), and I think it is much more straightforward just to FTP the files over to the EC2 instance rather than trying to deploy them through Eclipse.
For your other question, it is completely straightforward pointing Hibernate.cfg.xml to RDS. You will probably have no issues doing so, as long as you remember to give the correct permissions on RDS. Hope it helps.
Related
I have two spring boot applications with shared database. Locally everything works perfect, I can run war files (tomcat is embedded) on ports 8080 and 8081.
Question is, how I can run it on AWS?
I know, there are a lot of possibilities, but I am really a beginner and have no experience. I just tried to run it on AWS as it is (as .war files) and open ports... this is working of course. But this is not secure for PROD. Another issue, I cannot serve it as HTTPS.
My imagine is described in the picture. Probably there should be some splitter (marked as ???X1) in the front and some container for the applications (???Y1).
Please, could somebody help me here? What is the best/simplest/the most secure/best performance solution.
Q2: I am not sure, whether I should use embedded tomcats for war applications.
Thank you in advance
picture of architecture
Launch your both apps on one Ec2 Instance( WebServer Instance) , use different ports (80,81), Launch this Ec2 instance in Public Subnet.
Launch another Instance for your Database and keep that instance in Private Subnet.
this Database instance will be accessed by only Public subnet's Instance ( WebServer Instance)..
keeping Database Instance in Private Subnet will make it secure as no one can access it other than your own webserver.
OR
Use Amazon RDS for your Database, which is managed service and secure one.
The "splitter" thing in your image would be an Application Load Balancer on AWS. And you can create free SSL certificates in AWS ACM that can be attached to the Application Load Balancer.
I am sure this question has been asked and answered before multiple times. But unfortunately, I am still not clear. Here is my issue.
I have a JSP, Servlet application which uses MySQL as the database. I have built the WAR file as well. Now I am in need of deploying this so it can be accessed online by anyone.
I looked into lot of areas including normal web hosting. However even though the services like DailyReazor are highly secured, they provide little for MySQL, around 250 MB for the package I selected.
Now I am looking into Amazon AWS. In AWS I am expecting to deploy my aplication and make it available online.The MySQL server should not contain limits like 250MB.
But I have never ever used this service AWS before. By reading various posts, I know that Elastic Beanstalk is the easiest way to go, but still not convinced about how to deploy it properly with database access and all. And in the other hand, will they give me a web address like "www.example.com" or will they simply provide an IP address?? I am also familiar with tomcat so I need to use it.
We will not upload files (images etc) at the moment, so I believe we can manage with around 20$ per month?
I really appreciate if someone can provide a clear guidance on deploying java web applications in Amazon, with the requirements I mentioned about MySQL, Global access and so on.
Amazon RDS for MySQL is a Database-as-a-service offerring from AWS. It is scaleable up to 3TB, and has scaleable IO as well. Of course it also depends on how much you prepared to pay. they manage the DB for you (backup etc). You get a URL to connect, credentials and you are set to go.
Amazon Elastic Beanstalk uses Tomcat. So you should be familiar with that. You upload your WAR file and specify what EC2 flavor you want (CPU/MEM etc). They launch a VM that is configured with Jva and Tomcat and deploy the WAR for you. You get an IP address.
Amazon Route 53 is the DNS service, where you can assign the IP address to your domain (assuming you have one)
I have managed to create my first JEE application. Now I am trying to publish it online, I tried openshift and Amazon EC2 tutorials but none of them worked.
So is there another way to deploy it ?
folder's tree
If it's working locally then you're almost there.
Check this out. Will's answer should answer your question.
If you work for a company and have a server set-up there, you could reroute your domain to the company’s server and do the same. In this case, you can deploy your webapp on a virtual machine at port 80. This VM's IP address will be the one which your domain reroutes to.
The procedure is pretty much the same in both cases.
I am trying to deploy a JSP/servlet onto a server. Not tomcat but on a real web domain. This is my first time doing so and so far I exported it into a war file and placed the file onto the server. Nothing happened which is why I am here. All the google searches seem to concentrate on Tomcat which I have already ran the project on. Advice?
Ok, let's get really basic. You want to see the compiled JSP in a browser, through some public URL, right?
First, find a place to host your application. You can try Digital Ocean (starts at $5/mo), EATJ (free version available), Amazon AWS (free trial available), OpenShift (free gears available), your own computer with dynamic DNS, or many other options available through Google.
Next, you packed your compiled code to a war file. That war file needs to be unpacked (deployed) using some software.
There are numerous ways to handle this (Tomcat, Jetty, Glassfish, etc.). They all have their pros and cons. Pick one and learn the very basics. Tomcat doesn't require a separate web server but you can set one up with it if you like. At this stage, I would keep it simple and not do that yet.
Lastly, set up GoDaddy (or whomever you used to get your URL) to point to the IP address of that server. If your server is running and enough time has passed for the changes to propagate, you should see your page.
There are plenty other J2EE server for example, JBoss and Glassfish. Each one has it's own way to deploy your war files. For example, Glassfish is throught a web administration console (https://docs.oracle.com/cd/E19798-01/821-1757/6nmni99aj/index.html) and in JBoss you need to deploy the war file in a specific directory (http://docs.jboss.org/jbossweb/3.0.x/deployer-howto.html).
It depends on which J2EE server you are using.
Now if you want to get your own server and configure it:
Get the server or VPS
Install JAVA
Install Apache
Install a J2EE server (I prefer glassfish)
Configure glassfish with apache (http://www.codefactorycr.com/glassfish-behind-apache.html) to use apache in front of glassfish
You may want to block the ports 4848 and 8080 used by glassfish
Deploy your webapp
Have fun!!!
PS: I'm assuming you have root access to the server
Easy Apache Tomcat 7 install after,
Run Code via SSH:
/usr/local/cpanel/scripts/addservlets2 --domain=domain.com
For Linux.
I'm currently having 2 Weblogic admin servers in 2 different domains created on the same machine.
I want to convert one of the admin server to a managed server and then use them together to deploy a Java application. Is this feasible? If yes, how?
I'm currently using Weblogic Server 10.3.
PS: I'm quite new to Weblogic domain creation and administration. Please revert for any more details needed.
The simple answer is no, however, adding a managed server to a domain is extremely simple. See the documentation here. When deploying your application you'll need to target both servers or create a cluster (also very easy), add both machines to it and give the cluster name as the target.
Note, it is generally not concidered best practice to target applications to the Admin server (although it's fine when you're developing on your local machine). If you have the resources available on your environment, you could create two managed servers and put them in a cluster. Depending on the configuration of your Admin server, you may be able to reduce it's size if memory is tight.