Configuring Tomcat as a service on Linux Mint
When installing on Windows, the setup configures Tomcat as a system service. This way, it will start when the computer boots without any user action. Are you wondering why do you have to manually start and stop Tomcat on Linux? You do not. As for Windows, the Linux operating system can be configured for an automatic start of programs.
In this section, you will create a script and learn how it works:
- Download the
tomcat
file from the Packt site for this book and save it on your machine. You have to move it to the/etc/init.d
folder. - Open it with the
vi
editor as follows:
~ $ sudo vi /etc/init.d/tomcat
- There are some key settings you need to check in this file. The following lines contain the location of JRE and Tomcat. You can modify them according to your environment:
export JAVA_HOME=/opt/java/jre1.8.0_121
export PATH=$JAVA_HOME/bin:$PATH
export CATALINA_HOME=/opt/apache-tomcat-8.5.13
- Now, set the permissions for...