How to start tomcat service on Ubuntu restart

I have installed tomcat on Ubuntu system. I need to configure tomcat service such that it starts on Ubuntu machine is started.

1 Answer

Start the Tomcat service by executing:

sudo systemctl start tomcat

Check the service status with the following command:

sudo systemctl status tomcat

OUTPUT:

⬤ tomcat.service - Tomcat 9 servlet container Loaded: loaded (/etc/systemd/system/tomcat.service; disabled; vendor preset: enabled) Active: active (running) since Wed 2018-09-05 15:45:28 PDT; 20s ago Process: 1582 ExecStart=/opt/tomcat/latest/bin/startup.sh (code=exited, status=0/SUCCESS)
Main PID: 1604 (java) Tasks: 47 (limit: 2319) CGroup: /

If there are no errors enable the Tomcat service to be automatically started at boot time:

sudo systemctl enable tomcat

To allow traffic on port 8080 type the following command:

sudo ufw allow 8080/tcp

Here are all steps

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like