How can I deploy a Spring Boot REST API to BanaHost cPanel? - spring-boot

I created a full stack application (Angular front end, java spring boot back end, mysql database), and I was able to upload successfully both the angular files and mysql into BanaHost cPanel, however I have not found useful information on how to upload spring boot REST API, as a consequence only the front end is working. How can I deploy this REST API on cpanel?

Spring Boot Applications can't just upload and deploy if you're utilizing a cPanel Web hosting (shared) plan, like you deployed the Angular Application by uploading.
For spring boot you must do it yourself, a Virtual Private Server or Dedicated Server will unlock the site hosting restriction. If you are not much familiar with the Linux command line, you can use a Window VPS instead. Providers like, Digital Ocean, Linode, and Oracle Cloud all provide free trials.
And also, there are platforms, such as Heroku (Platform as a Service(PaSS)), where you can deploy your app without the need for a VPS. You can refer their documentation regarding this:
https://devcenter.heroku.com/articles/deploying-spring-boot-apps-to-heroku

Related

Deploy SpringBoot Api into IIS Web Server

I created spring boot api with gradle build. everything working fine in my local.
I deployed angular app in Sites/DefaultsTest in IIS web server. it run in https://example.app.com/app
SpringBoot API base path is '/api'
I want to deploy spring boot api in same windows server machine and should able to access through Angular App globally.
please guide me.
IIS WebServer Dashboard
As far as I know, the spring boot API is a java web application, we don't suggest you directly hosted the java web application in the IIS.
I suggest you could try to install a docker or using tomcat to host the application, then you could use IIS reverse proxy to redirect the request to that API to get the result.
More details about how host the spring boot application on the docker, you could refer to below article.
https://blog.codecentric.de/en/2017/04/ansible-docker-windows-containers-spring-boot/
More details about how to use IIS reverse proxy, you could refer to below article.
https://blogs.msdn.microsoft.com/friis/2016/08/25/setup-iis-with-url-rewrite-as-a-reverse-proxy-for-real-world-apps/

Deploy my spring boot application into google cloud computer engine

I got a query to ask you all. I am looking for guides that help me deploy my spring boot application on google cloud computer engine, I type in my instance IP address when I test my spring boot application I unable to access it in REST API.
May I know do you have any guides or steps for me to follow to deploy successfully in google cloud computing engine. Why do I need to deploy in computer engine is because I deployed my angular at it and I deploy it both it seems that my angular project being replaced by my spring boot application.
Codelabs GCP / Spring series has deployment tutorials:
https://codelabs.developers.google.com/spring/
GCP has some "Getting Started" tutorials you can use here:
https://cloud.google.com/java/docs/
where the specific one for deploying a java app to GCE is here:
https://cloud.google.com/java/docs/tutorials/bookshelf-on-compute-engine
But the basic steps are as follows:
Write your Spring app
Build your Spring app
Run / test your jar locally
Push your jar to a location in Storage
Create a startup script for your GCE instance
Create a new GCE VM which uses your startup script using Console, Deployment API, or gcloud tool
After that, you need to ensure you have the proper network rules in place to be able to access your API publicly. If you do not wish to learn how to use GCE, I would suggest you look into using App Engine instead because then you do not need to learn how to deploy and instead can concentrate on your api. Here is a guide to do that

Keycloak Server on Heroku

Currently I'm working on a Spring Boot 2 project where we use Heroku as our Cloud Service. We push our changes to Github and our instance on Heroku cloud gets provisioned and deployed. After participating Javaday in my city, I attended to a speech and got to know about this amazing framework, Keycloak. After some investigation, we have decided using Keycloak as our identity and access management.
From what I understand, we need to start a Keycloak standalone server as explained here https://www.keycloak.org/docs/latest/server_installation/index.html.
But the problem is, we cannot access to filesystem on Heroku instance and thus, cannot extract the Keycloak files and start the server.
I tried to follow these steps https://github.com/yurtsevich/keycloak-swarm-heroku yurtsevich has provided but I noticed that latest version of Keycloak Swarm is not compatible with Spring Boot 2.
Can we start Keycloak server on the same Heroku instance we have? I'm unable to find any solution to this at this moment.
Edit: this button from readme will deploy Keycloak on Heroku with free dynos: https://github.com/sannonaragao/keycloak-heroku
This button deploys the lastest version straight to Heroku.
https://elements.heroku.com/buttons/mieckert/keycloak-heroku
Beware! It deploys at the Performance-M dyno, you must change to free right after if you don't want to pay some use fee.

UI application in Pivotal Cloud Foundry

I have a UI application built using Angular , Bootstrap and HTML5 which interacts with number of backend services. In order to deploy this application in PCF , should this be converted to a Spring Boot app? Or is there a way to use any of available buildpacks to deploy this UI app in PCF?
In case there is no need to deploy backend services, I would go with the cloudfoundry static buildpack.
http://docs.cloudfoundry.org/buildpacks/staticfile/index.html
Otherwise you will need to decide how you are going to deploy the backend services for this application. There are a number of buildpacks available that could be used for deploying the backend services and delivering the frontend content within the same app (one of them being, as you mentioned the java buildpack that can be used to deploy a spring boot app). Here is a list of available buildpacks:
http://docs.cloudfoundry.org/buildpacks/
Its not needed to convert your application to spring boot, but doing so will definitely make life easier for you, trust me. Once u convert ur app to a spring boot right, you can remote debug ur application by jst running ur app as a spring boot app.

Deploying Spring boot app to digital ocean

I am trying to deploy spring boot app written using jhipster to digital ocean. I user tomcat manager to deploy. The deployment went fine and I am able to access the html pages, but my rest apis are not accessible. I get 404 when I try to access any rest api.
I also don't know where my application startup logs are going (they are not there in localhost-access.$date.log) file under logs directory. AM I missing any configuration?
Any help or suggestion is appreciated.
The issue was with my droplet's limited RAM and memory. I noticed the JVM was not running. When I increased size of RAM it started working just fine.

Resources