I have a .JAR file which contains my Spring application with all its dependencies. I also hired a VPS which today the support tells me that their VPS are " unmanaged ", that is, not managed (I don't know if this makes what I want to do impossible).
The DocumentRoot
which is in the directory /etc/apache2/sites-enabled/
points to /var/www/html
. Here is a file with the extension .html which is the default file that the browser loads when making a request to the domain that points to my server.
Without having much knowledge of the subject, I have uploaded my .JAR file to that directory and from the command line with java -jar file_name.jar I execute my application. It gets up and starts without problems, but when I enter my domain again I get the typical page with the title
" Index of / " and the list of files in that folder.
I have everything installed on the server, mysql, maven, java, etc.
Does my application go in another directory or does this type of application run on unmanaged servers ?
By default, a Spring Boot application starts up listening on port 8080, so if you haven't configured your application to use another port, it will use the same port on the server.
If you want your application on the server to listen in 80, stop the Apache server that you have running (and that is the one that serves you that content that you are seeing) and start the app like this:
Even so, start the app and try to access your domain:8080 to validate that you reach it