Good day, there is a spring boot project, I wrote a rest server, everything is going to be a gradle in JAR, a connection with mongodb, everything works, but I can't figure out how to use it in production, that is, where to prescribe what to change the connection port and address and tp, or it is done on a rented car (VPS).
Closed due to the fact that the question is too general a participant Nicolas Chabanovsky ♦ 15 Sep '16 at 6:37 .
Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .
- oneIMHO question is too "wide." Everyone has different production and advice will be different too. - Slava Semushin
- @SlavaSemushin I understand, but I need to understand which way to dig, I need to write some kind of config if yes how, or maybe it is done on a Wirth machine - newakkoff
- oneTry to act as necessary, if you do not know which way to dig. Begin to install the application on the server and as issues arise, solve them. For example, how to change the port, how to specify other database settings, how to make the service start after the server restart and so on. - Slava Semushin
1 answer
On servers, it is usually customary to separate the Front-end and Back-end for Web applications. In your case, the back-end is the application itself, made using Spring Boot. Nginx or Apache Http Server can be used as Front-end. This approach allows you to change the ports and access addresses for resources on your server, cache static content, etc. For example, if you have 2 web applications on your server, each of which is tied to its own port (say 8080 and 8085), then with the help of Nginx you can arrange access on the standard port 80 using different URLs for each application ( http: // localhost / app1 and http: // localhost / app2 ). Front-End can be called an additional level of abstraction that gives flexibility in configuring the infrastructure of your server.
- I just could not understand what manipulations I needed to do after renting a VPS so that I could connect to my rest, I understand you just need to configure Nginx? - newakkoff
- @newakkoff your question is really not too specific. For example, I can describe the standard configuration of servers in our company: 1. First of all, the firewall (iptables) is configured according to the principle that everything except the necessary ports and protocols is forbidden (for http it is 80 and 443). 2. Access to the server via ssh is open only on certain ip; 3. As the front-end is configured nginx; 4. Everything you need for the application to work is installed using Docker containers (web server, database, etc.) - Sergey Bespalov
- I will use this rest for android applications to get data from the database in json, and I don't know how to organize it - newakkoff
- The second part of this article should help you: habrahabr.ru/post/257223 - Sergey Bespalov