How/where to host a Webservice?

Asked

Viewed 1,403 times

-1

Hello, I participate in a volunteer project at my college and would like to create a Web Service to help in the internal process and learn a little more about the subject. Our team has the following environment:

  • A website hosted at Hostgator.
  • A software that uses the database provided by Hostgator.

However, I would like to create a system to interact the site, the software and another application (Android and iOS), so the need to create the Web Service. The initial idea was to create it in java, because I have more experience and ease in dealing with the language, but Hostgator does not support Java, as I was informed by the support. Furthermore, I believe that website hosting services cannot be used to maintain a Web Service.

Here comes the doubt:

  • Is there any way to host the website and web service on the same hosting service? How?

  • If it is not possible, there is another type of service in which I can maintain both or I have to leave the site there and the Web Service in another service?

I have researched here and in other forums, but I did not find an answer that fully answer.

If you know any course, video lesson, bibliography, website, tutorial that can complement the answers, it would be of great help.

  • Philip, I’m a layman too, but have a suggestion. What if you could create the Java webservice yourself, host on a college computer that isn’t shut down, and use services like no-ip or ddns to access it? Have you ever thought of such a solution? I know it may not be the best thing, but maybe for the beginning of the project I can help.

  • You can take an Amazon computer and assemble whatever you need there. There is also the possibility to use Heroku https://devcenter.heroku.com/articles/getting-started-with-java#Introduction

  • @Rodrigotognin this was one of the first solutions I tried, but my college is kind of restricted to let students use these services :s And also because it’s a student-only project it would be a cool learning experience to do it all from scratch. But I appreciate the help anyway.

1 answer

1


You need some things to have a Webservice, in Java, I will not be able to pass any help, however in this answer I will try to help you in how to host a Webservice.

The answer is that it is relatively possible to make a Webservice on a shared hosting on Hostgator, but you would end up having some problems, and I believe the main one would be to debug the code in production, since you would not have access to a shell.

Now, so where it would be easier to maintain, you have an EC2 server in AWS, if your application doesn’t need many features, you can even use the free layer for a period, in the EC2 server you could publish both the site, like Webservice, of course you’ll need to be more careful with server security settings, firewall, proxy, or whatever you want to use, but that wasn’t the case with the question.

How to create an EC2 instance

  • Access AWS
  • Create an account, activate the valid credit card, you will not be charged, but it is necessary to free layer.
  • Inside your console search for 'EC2', click 'EC2''
  • Click 'Launch instance', follow the steps to create the free instance.

Create the database in AWS

  • Inside the console search for 'RDS', click 'RDS''
  • Click on 'instances'
  • Click 'Launch DB instances''
  • Follow the steps to create the free instance according to the database you use.

To publish

  • Develop your project in your local environment.
  • Set your instance exactly as your local environment.
  • Switch local endpoints to endpoints for your instance.
  • Upload your project to some project hosting, if i GIT you can save your project on Gitlab, that allows you to save private projects for free.
  • Log into your SSH instance, download and run your project.

Google also offers a free layer to test your VM’s, you would have something very similar to Google Compute Engine, but I believe that AWS is easier to understand if you have never operated with it.

Refs:

EC2 RDS

Of course I am considering that you will know how to configure the server, if you do not know how to comment that I complement the answer, I will soon delete this excerpt.

  • I believe that Digitalocean would also be a very good thing...

  • @Thank you very much. That’s exactly what I was looking for, I’m starting to work with Web Services and my biggest difficulty is being this and I haven’t found much information about it on the internet. I will try to implement the way you indicated me and research more on the subject to better assimilate your tips, but it was very helpful, thank you very much!!

  • 1

    @Evertongouveia thanks for the recommendation, I will research more on!!

  • @Felipemartins Glad you helped hehe, if the answer solved your problem, could accept by clicking on the 'check' green, so other people can know that this question is already solved ;).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.