skip to Main Content

I started to develop with Spring boot and Angular 10 and today I’ve to deploy but I don’t how and where deploy. I’ve read a lot of article but I don’t get the difference between an app server and web server.

I want to use Tomcat (app server) to deploy both of them it is a good decision ? or do i need to use Tomcat for Spring boot and Apache HTTP or Nginx for Angular?

I also use a 3 tiers architecture

Client < =http request response => app server < =SQL request response => DB 

If I have to use both server, do I need to use 4 tiers architecture ?

Client <= ?? => web server < =http request response => app server < =SQL request response => DB 

2

Answers


  1. I’m not work with angular, but I’m using react I think they are same ..

    first way is:

    1. bulid our react code.
    2. then deploy it to public folder in the server.
    3. then deploy spring boot app to tomcat .
      attached image for the public folder which contain index.html (build)

    secound way is:

    to configre (Apache or Nginx) route to point to frontend and backend.

    Login or Signup to reply.
  2. A. Deploy Spring Boot Application
    Spring Boot have tomcat in itself so you can easily deploy it as below steps :-
    1> Build jar file
    2> Upload it on server (in any directory)
    3> go to that directory and use command **java -jar filename**. for example :- java -jar myApplication.jar
    
    B. Deploy Angular Application
    1> Build project (using ng build --prod, this will creates file in dist/your-project-name directory in your project)
    2> Upload the filles, which is created in dist/your-project-name directory, to tomcat's ROOT directory (your-tomcat-directory/webapps/ROOT/)
    3> restart tomcat and it's done
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search