Hosting webservices for android App - java

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.

Related

What's the procedure of upload a java spring based web application to the real server, and how to use load balance to the server?

I am creating a simple web project with mysql database using Java Spring-MVC. Now I want to understand the full workflow of the web system development cycle.
How to upload a project to a real server?.
How to sync the database to a real server?.
How DC and DRC is sync with each other?.
Why and how to use "Load balancer" to the server?.
Apologize, if I said something non-technical.
I'll not go into too much details but here is the gist of it.
Before anything, the first thing to get sorted is the operating system of the server be it Linux, Windows Server and so on. The choice of operating system will depend on the constraints and requirements.
How to upload a project to a real server?
Any files which needs to be served should be hosted and served by a web application server such as Apache Tomcat, IIS, Websphere and many more.
The choice of web application server depends on a few things, such as the server operating system, the web application implementation and so on. For your case, which is a Spring MVC implemented in Java, you'll need to use a web application server that supports that, such as Apache Tomcat for example.
Once the choice is made, install the web application server on the server. After that, install your web application on the web application server.
How to sync the database to a real server?
I infer that you're referring about the connectivity between the Java web application to the database? Do comment if its not.
The Spring MVC web application can connect directly to the database via JDBC or JNDI (provided that the necessary configuration is configured on the web application server).
Of course, the database can be connected locally (if installed on the same server) or remotely.
How DC and DRC is sync with each other?
This is too broad to cover and the recovery strategy differs for every Data Center providers. But broadly, they employ redundancy and replication strategy to ensure the data is always backed up and available. Check with the providers individually for a better picture.
Why and how to use "Load balancer" to the server?
The load balancer primary purpose is to distribute the work load across multiple servers to achieve better TTFB. To do so, it sits in front of the servers and routes the request accordingly. Some of the load balancing solutions such as f5 explains about load balancing in greater detail.
Step 1: Install Application Server on your machine.
Step 2: Install JDK, Database server which are dependent on your application.
Step 3: Export your war from Eclipse/Netbeans
Step 4: Paste your war file on app server's deployment folder (webapps incase of tomcat)
Step 5: your application deployed

Where to host a Restful web service in JAVA in shared hosting solutions

I have just finished developing a REST web service that is consumed by a mobile application. The web service is developed with Java and runs on an Apache server.
I'm now moving to the testing part. And for that purpose, I need to host my web service in a real server.
It is a first experience for, and I just knew that using mutualised (shared) hosting does not allow me to host whatever application, in whatever language.
The one I get to use is OVH, which does not support java web services hosting.
Does anybody have any other alternative to provide. It would help a lot!!
Like I said, if it is for testing purposes you could always use a "normal" PC, running something like XAMPP.
As an alternative you could give RedHat's OpenShift a try, which offers a free, getting-started plan (more info here) that should more than cover your testing requirements.
To run your app (in Eclipse) you would need to : Run As -> Run on Server
And then select a server. If you haven't done so; I suggest you install a local JBoss/WildFly server (the wizard can take care of that for you).
Doing this will display options to run your app either on the local or the OpenShift/rhcloud server.This makes testing faster and allow you to avoid testing on the OpenShift live server.

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.

Server to run java servlet

I'am developing a java servlet application, and tesing it on Eclipse + Apache Tomcat (refer: http://www.vogella.de/articles/EclipseWTP/article.html#overview_wtp).
The application is now tested on the localhost and accesed by any clients on the same LAN.
Now, I need to deploy it into the web server, where everyone from anywhere can access this servlet.
Coud you guide me the way that I've to do to archive this task.
You need to have a computer accessible to everyone - i.e. placed on the internet and not behind a firewall - with the appropriate software installed (and hardened against hacker attacks).
If you do not have such a computer, you can have a look at the Google Application Engine which allows you to deploy Java web applications (with some additional restrictions) to the Google cloud. This is free for low-volume applications.
Yes, you can do it by deploying your application in the Cloud Instance. Since we cannot able to make our server instance or computer to be run always(We may come across internet connection problems, Power Fluctuation, etc.,), We have lot of problems while making our instance public(In Security perspective too). So it is better to use cloud instances.
We have many Cloud Service Providers such as AWS by Amazon, Google Cloud, Microsoft Cloud, etc.,
Take a look on this List of Cloud Services Providers.(You have links for all top 10 providers)

implement webcache as web application

looking for someone to verify whether this approach is good or not . let say i have web app A run on tomcat. By deploying one webcache web app on the same tomcat. will that minimum the likelyhood that my web app crash due to overload by web visitors? if yes, what webcache should i used to implement this technique? or should i forget about webcache deploy this way and user service like akamai instead..? low cost is my main priority. looking forward to hear from you all
By duplicating on the same server/machine you gain nothing. When many users rush to the website, you would need more system resources to serve them and since these are shared by all web apps the second installation will be in as bad situation as the first one.
To properly cluster a web application you need more servers. You install Tomcat and your web application in each one and then use a load balancer to share the traffic. This is usually implemented with Apache Web Server and mod_proxy or mod_jk. Of course you need to pay for the extra server. One solution would be to deploy your app in a cloud environment (like Amazon EC2) and start the second server only when needed.
Another solution is to scale up, that is use a more powerful machine.

Categories

Resources