Skip to content

How to run application without IDE or gradle how to configure apache

enmust edited this page Feb 27, 2018 · 3 revisions

How to build executable war file

In order to run the application, first, you need to run following command in the project root folder (where build.gradle is located):

gradle bootRepackage

This command will build project and produce geocollections.war file to build/libs folder.

How to run executable war file

geocollections.war can be run using following command:

java -jar geocollections.war

You can choose different profiles (environments) with --spring.profiles.active= key:

java -jar geocollections.war --spring.profiles.active=jenkins - if you want to run application with jenkins profile.

java -jar geocollections.war --spring.profiles.active=prod - for prod profile

Default server port is 8082.

More detailed profile description is available here: Environment profiles

How to forward log output to file and release console without shutting down application?

java -jar geocollections.war --spring.profiles.active=prod > /path/to/logs.log

How to configure Apache?

Since our application is another HTTP server (Tomcat), you will need to configure Apache to forward requests to it (first, you need to run it). Please refer to /etc/apache2/sites-available/geocollections.conf file.

By the way, we needed to replace in all configuration files in /etc/apache2/sites-available in the very first l ine <VirtualHost * star with domain name eg geocollections.arendus.geokogud.info to ensure that requests are properly forwarded.

For configuration changes to take effect, you need to restart Apache:

sudo service apache2 restart