2
votes

So I've followed the list of steps on : https://www.digitalocean.com/community/articles/how-to-install-apache-tomcat-on-ubuntu-12-04.

When I try to run the startup script $CATALINA_HOME/bin/startup.sh, I get this message:

Using CATALINA_BASE: /usr/share/tomcat7
Using CATALINA_HOME: /usr/share/tomcat7
Using CATALINA_TMPDIR: /usr/share/tomcat7/temp
Using JRE_HOME: /usr/lib/jvm/default-java
Using CLASSPATH:
/usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar
touch: cannot touch `/usr/share/tomcat7/logs/catalina.out': No such file or directory
/usr/share/tomcat7/bin/catalina.sh: 389: /usr/share/tomcat7/bin/catalina.sh: cannot create /usr/share/tomcat7/logs/catalina.out:

What am I supposed to do to get that startup script to work?

2
try sudo $CATALINA_HOME/bin/startup.shstudy
I get :/var$ sudo $CATALINA_HOME/bin/startup.sh Using CATALINA_BASE: /usr/share/tomcat7 Using CATALINA_HOME: /usr/share/tomcat7 Using CATALINA_TMPDIR: /usr/share/tomcat7/temp Using JRE_HOME: /usr Using CLASSPATH: /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar touch: cannot touch /usr/share/tomcat7/logs/catalina.out': No such file or directory /usr/share/tomcat7/bin/catalina.sh: 389: /usr/share/tomcat7/bin/catalina.sh: cannot create /usr/share/tomcat7/logs/catalina.out: Directory nonexistentsportsfan72
do you install tomcat using apt-get?study
@study, yes I did sudo apt-get install tomcat7sportsfan72
try sudo service tomcat startstudy

2 Answers

3
votes

Try to:

mkdir /usr/share/tomcat7/logs/; chown user_running_tomcat /usr/share/tomcat7/logs
3
votes

You installed Tomcat as the root user (which is the default installation via apt-get), and so some of its directories are under ownership of root. Which means you would have to call the startup script using sudo ./startup.sh.

I don't recommend the apt-get installation of tomcat at all, because it installs files all over your system and it can get rather confusing. I recommend downloading Tomcat directly from the Apache site instead.