how to stop tomcat7 in ubuntu?

Solution 1:

Generally any service in Ubuntu can be managed by

sudo service <service_name> <argument>

Here service_name stands for name of the service, in your case it is tomcat7.

Argument stands for type of the action like start,stop,restart,status, in your case it is stop.

so finally you can stop tomcat7 with this below command.

sudo service tomcat7 stop

Solution 2:

I've tried almost everything I found for this but I finally concluded this to be the best, simple and precise solution:

sudo systemctl start tomcat

This one is for starting the service

If you want to check the status then

sudo systemctl status tomcat

And for stopping:

sudo systemctl stop tomcat