Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start Tomcat with output on console in Linux? [closed]

I know it's possible to start tomcat and then run tail -f catalina.out to view Tomcat output. But how to run tomcat and view output at once? Are there some options to run startup.sh with?

like image 827
Igorock Avatar asked Dec 23 '12 11:12

Igorock


People also ask

Which command is used to start Tomcat server in Linux?

"Catalina" is the script that is actually responsible for starting Tomcat; the "startup" script simply runs "catalina" with the argument "start" ("catalina" also can be used with the "stop" parameter to shut down Tomcat).


2 Answers

You're looking for

tomcat/bin/catalina.sh run 

instead of

tomcat/bin/startup.sh; tail -f tomcat/logs/catalina.out 

Tomcat stays in foreground this way (first option). If you want to shut it down, Ctrl-C in your console window will do the trick.

If you choose the second option, tomcat will run in background, while tail will run in foreground, but you'll have to give the same directory path twice.

like image 175
Olaf Kock Avatar answered Sep 17 '22 23:09

Olaf Kock


Instead of using service, cd to Tomcat's bin directory, type ./startup.sh. This will start Tomcat in console.

All the logs that goes to catalina.out you can modify it by this link : Tomcat logging

like image 29
vels4j Avatar answered Sep 20 '22 23:09

vels4j