Ubuntu – the Tomcat Logs

tomcattomcat6Ubuntuubuntu-9.04

I installed Tomcat6 on a Ubuntu 9.04 server using apt-get install tomcat6. I uploaded a WAR using the manager interface and tried to start the application but get a pretty generic error on the Web interface saying it couldn't be started.

I am trying to find the logs to determine why my war won't start (I suspect low memory as i'm on a small VPS) but I don't know where they are.

/var/lib/tomcat6/logs is empty. My Tomcat splash page reliably informs me of the following;

Tomcat is installed with CATALINA_HOME in /usr/share/tomcat6 
CATALINA_BASE in /var/lib/tomcat6, 
following the rules from /usr/share/doc/tomcat6-common/RUNNING.txt.gz.

UPDATE

I tried running;

$ ps -ax 
/usr/bin/jsvc -user tomcat6 -cp /usr/share/java/commons-daemon.jar:/usr/share/tomcat6/bin/bootstrap.jar -outfile SYSLOG -errfile SYSLOG -pidfile /var/run/tomcat6.pid

But there is nothing in /var/log/syslog

Also runing

$ losof -p PID

didn't show any log files…

$  for PID in $(pgrep jsvc);do sudo ls -l /proc/$PID/fd|grep ' 1 -> ';done
l-wx------ 1 root 500 64 2010-03-30 13:29 1 -> pipe:[301470406]
lrwx------ 1 root 500 64 2010-03-30 13:29 1 -> /dev/null
l-wx------ 1 root root 64 2010-03-30 13:29 1 -> pipe:[301470406]

Thanks,

Gav

Best Answer

Very late to this discussion, but it appears that the 03catalina.policy file in both tomcat5.5 & tomcat6 doesn't actually permit writing to logfiles.

The simplest solution is to change the JULI permissions to:

// These permissions apply to JULI
grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
    permission java.security.AllPermission;
};

Obviously, there may be security issues I'm not aware of, but I really can't be bothered to dig deeper - I've spent too long on this myself.

Related Topic