Deploying a java web application online - java

I have built a java web application on Eclipse. But i am naive in terms of making an application live i.e. deploy it online. I have tried using Cloudbees, and succeeded in deploying it at run#cloud there, but could not see it actually running. I haven't purchased any domain name as of now, therefore I would like to try it on any free domain first. If I want to make that application live, what would be the exact steps that I'll have to follow ?

Use Redhat Openshift Cloud...
Redhat Openshift is a Cloud based service which provide PAAS(Platform As A Service) i.e. Use their Server and upload our Project.
Redhat Openshift also provides MySql , Postgre and MongoDB.
It Easy to understand, Simple to Configure and Auto-Scalable.
Redhat Openshift supports:
https://dl.dropbox.com/u/24576260/Redhat%20Support.png
There are alternatives of Redhat Openshift - Google App Engine (GAE). But GAE restrict some of the class usages in Trial Verison.
Whereas Openshift have kept open and whatever user wants he can use and configure it.

Try Jelastic.
They have a free trial as well.
PS: Works for me each time.

If you have deployed successfully to RUN#cloud then your app is already running; there is no need to purchase a custom domain. If you log in to https://grandcentral.cloudbees.com/ and click on the Apps tab, you should see your new application listed; the show in new window link will open the live web page. (This will be http://appid.accountid.cloudbees.net/ where appid is whatever you chose when creating the app, and accountid is rishabh85 or whatever your CloudBees login name is.)
You can also load this page directly from Eclipse, if using the CloudBees SDK (use http://eclipse.cloudbees.com/ to download or http://blog.cloudbees.com/2012/07/getting-started-with-cloudbees-and.html for more information). Configure your account information, and open the CloudBees view (available from the CloudBees toolbar button), and you will see your running apps. A context menu item lets you open the selected app live in a web browser.

Try Google app engine. You can deploy your Web applications and you ll get a free sub domain.

As I have small knowledge of working like this, its very easy. This is to inform you that its works like your own pc. In my last company they had a Windows server.. and Tomcat & MySQL was pre installed on that server. I just place my .war in the proper place & imported the blank DB.. and its starts working :)

Checkout my blog posts on creating a web service from scratch using Cloudbees. It's a series of 7 posts that have everything you need in order to get your service up and running (including an opensource code base with almost everything you need already integrated)
If you just want the fastest way, checkout this youtube video.

Related

How to deploy an application [Looking for advice]

First, I don't know anything about deployment.
Here is my application :
I got a rest API backend using Spring Boot with a MongoDB using MongoLab. My frontend is built using React (webpack, cypress).
I have this full application on gitlab in the same repo, with different folders (ie backend, frontend).
Where can I deploy this application? I guess I need to deploy separately those services. If you guys have any advice and give me some tutorials I could follow. What URL can I use like api.example.xx for back and example.xx for the front ?
Any advice is appreciated.
Thank you
Your question is too broad to get a summarised answer. I will give you a few hints that you can expand on.
For starters, since you do not know so much about deployment, I will recommend that you learn with a single machine than with multiple IP addresses. (no Docker, Kubernetes etc. just your applications on different ports)
NOTE: below are the tools you will need to familiarise your self with before this attempt.
linux terminal / GitBash for windows
SSH (communication with your server)
Git (repository managament and versioning)
Github / Bitbucket
Hosting services
Below are a few providers you can use to get you up and running although there are a turn other providers.
Linode hosting services - paid
Amazon Web services - paid/free
Netlify - paid/free
Heroku - free
All these provide you with either a terminal or GUI to deploy/maintain your applications.
Deployment
First, you will need to install all your application dependencies on the server of your choice. i.e. Databases (Mongo for your case) and other applications that support your app. (The same way you did on your local machine)
making sure that your project has the right configurations(passwords, reference URLs, etc.)
See here on How to deploy your spring-boot application
In the meantime, you can try hosting your ReactApp on Netlify and see how it works
As you said you already have it in Gitlab right,And if you want an easy solution and a way out of deploying world then you might want to consider using netlify
it makes deploying as easy as eating a piece of cake, just
Signup
Click on "New site from Git" Button
Select Gitlab in your case
Select the project you want to deploy and for netlify to install
It automatically detects build command and that's all, waits for your permission to build.
Once build is completed you can preview your application(there is a button for that in right corner) and then confirm your deployment.
*Plus it automatically deploys the changes in your git i.e pull requests,
you can choose whatever name you want your website to be(but should be available)

Google AppEngine Default container, Deployments

I'm trying to learn Google App Engine, though they're making it very difficult.
When I deploy an application through windows console or through Eclipse's GAE plugin, it works fine, but what am I deploying the application to? What web server/container is being used? Should I be able to see the deployed files in my google dev console?
Also, when I use the "click-to-deploy" feature to deploy an instance of tomcat, it sets it to a new URL as an "external" ip address. Why is this not being set to my project's appspot URL? Is this an entirely different server created in addition to the default one that is created automatically?
Searching for GAE info on the web just returns millions of pages about their offerings, but nothing to explain the behind the scenes stuff.
Thanks!
Let me break down the questions:
When you deploy through the console or the Eclipse plugin, you are deploying to the App Engine runtime. You can see what is running by going to the App Engine section of the Google Developer's Console.
This app is served from the .appspot.com domain as well.
Click-to-deploy is not App Engine, but Compute Engine. Compute Engine is more akin to a VM in the cloud. You get SSH access and a Linux or Windows operating system, but don't get all the auto-scaling and things built into App Engine. You would access this through the IP address, not the appspot URL.
I hope this helps!

Hosting webservices for android App

I am really new to web apps and web services... But i have created a webservice and it's working in localhost(apache glassfish) but i need to deploy this thing in an external se(in java)rver so that every one can consume that web service via my app..Unfortunately am unaware of this technique.
so can anybody help in this problem ? Can i host this webprogram in normal godaddy webserver or is there any other way for this..in fact, my app is a small one and i need the solution for small apps or startups
thank you
GlassFish hosting will be hard to find. If your application is not GlassFish specific and can be run on JBoss, then you might try RedHat OpenShift. They have free plan for small application load and you get for free server administration, database administration, deployment is easy, you might concentrate on coding only.
Another option is to use Heroku. You will also need to neglect GlassFish, but they have easy path to creation of REST web service backend.
I recommend renting a server at amazon:
http://aws.amazon.com/ec2/pricing/
You can take already existing images with GlassFish and a Database or take a naked CentOs/ Red Hat Image and install your GlassFish manually. The link provides a table with all prices. A m3.medium costs $0.070 per Hour. It's super fast and flexible and you have high availability.
In NetBeans you can deploy on a remote server via: Services -> Servers -> Add Server:
Just enter your ip, username and password for the GlassFish Server:
Or
You can host your Project on a Raspberry Pi. Maybe the power is enough for a small Web App:
http://www.thehecklers.org/2013/10/27/glassfish4-raspberrypi/
Advantage: It's cheap and you can learn and control a lot.

For J2EE project to run on different Computer what does it need?

I know for a Java Program to run on another Computer it needs JRE(Java Runtime Environment). But for a J2EE application (Serlvet-JSP) or Struts2 framework application or Hibernate framework application or any Framework application of Java what are need to Run it Successfully on another computer where it is not developed....
I know JRE is required for both type of Application. and JDK is for developing an application.
I also know that for Mobile application to run on device it needs an Emulator that supports the particular OS (Android, iOS, etc). Just like an Standalone Java Application.
But for running J2EE application is there any other requirements than JRE??
For Example:- I have made a site called SocialMash.com I want to have a working prototype to deliver to user (User meaning like we all use Stackoverflow and other sites). What will I require to configure the site.
I know I will require a server like Tomcat/JBOSS/GlassFish but that all will be on my side (server side/ development side) but Do the Users to use the site will require anything among JDK, JRE, Server, or anything to use SocialMash.com or just URL will be enough?????
You need to have a JavaEE application server. It runs on top of JRE. You can check this open-source reference implementation (full-profile, my favourite):
https://glassfish.java.net/
or if you want to have only web-profile:
http://tomcat.apache.org/download-80.cgi
Web profile is different from full profile in that web profile supports only Servlet-JSP, but not JPA (or hibernate as stated in your question).
Users will not require anything except for the browser in case you write a web application (Servlets+JSP, Struts, JSF, etc. - just give them a web reference). But you can go further than that. You can write a Java SE desktop client for EJB, or SOAP service (they will be placed in full-profile server like Glassfish), and distribute for your customers. In this way they will not require any browser, but your custom desktop program.
Some of the libraries require to be added to your application server and configured manually. Like Struts. In this case you first need to decide which framework/library you would like to use, then go to their web site, and follow the tutorial on its installation.
To host an J2EE application, a webserver is required that has servlet container. servers included in XAMPP/LAMP/WAMPP will do for php based application. But for J2EE application servlet container is rquired which is there in TOMCAT/GLASSFISH/JBOSS.
On the user side, the user sees pure HTML with additional js/css. He does not see the jsp scriplets/servlet code written in your J2EE application. so no java technology is required on the user system. He only needs a browser.
A J2EE project intends to create a web service. In order to run this project on your computer, you need a local server.
Any IDE can provide you a local server like Tomcat or Glassfish, you just need to try to run this project to get these options.
If you don't need to access the code on the other computer, two options:
You compile your project to get a .war file, which you can deploy on your Tomcat server, or any else.
You put this on a server of yours, and share the url.
Assuming that you are in charge of the app hosting:
If that the app is running on your own remote server, you just need to share the app url and your user can access it with his browser (nothing more is needed).
If you run it in your own computer, as localhost, he won't be able to access it, and I recommand the usage of a host like Openshift to make it accessible (that's a free solution).

linking my java web application to the web?

I am beginner java web developer, now my question is after i developed my application, how to make users see it on the web?
I used JSF,MySQL and GlassFish server in my development stage and now i want to publish it.
I got a domain name and an a web hosting account on goDaddy.com
In other words what to do after i develope my web application?
what steps should i take in server creation and other stuff?
I have searched alot but there is no specific way for it. I am trying to make this dynamic website based on jsf development--and it is already done--become alive and out their like any other web site?
any guide lines and steps should i take in making this steps ?
Either you will need a "Production" server to host the application yourself or use a hosting service of some kind that provides a Java EE container. If you're tied to Glassfish, you can Google for those providers like http://glassfishhosting.com/.
Other options that might be good fits for you are cloud services. Something like either Rackspace or Amazon EC2. Each has their own pricing tiers that scale based on usage. Good luck to you going Live!
Can host the code on Github and push it to Heroku.
http://devcenter.heroku.com/categories/java
I don't know the provider you chose but you need a java application server for your live environment. And optimally this should be the same server as your development server.
For our projects we buy a virtual server and install Glassfish on it. This costs around 15 € per month and we have the same environment for development and production.

Categories

Resources