Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have created a file so that I can start and stop tomcat via the terminal. I placed the file inside the /bin folder and performed chmod u+x on it to make it executable.

But then when I try the command tomcat start it just gives me the following:

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/java-6-sun-
Using CLASSPATH:       /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar
touch: cannot touch '/usr/share/tomcat7/logs/catalina.out': Permission denied
/usr/share/tomcat7/bin/ 538: cannot create /usr/share/tomcat7/logs/catalina.out: Permission denied

I'm a new to Linux. Please help me set up proper permissions for this. If not, then maybe I'll just move my tomcat folder elsewhere.

share|improve this question
First of all, you should place the file in /usr/local/bin rather than /bin. Also, if the file is called, you won't really execute it when you call tomcat, since the name is different. What's the content of your file? Have you tried just running tomcat with sudo tomcat start? – slhck Jan 27 '12 at 9:34

Use: mkdir -p /usr/share/tomcat7/logs/

share|improve this answer
thanks! this worked – Alex Okrushko Mar 11 '13 at 14:42

The simple answer to this is probably that you need to start the Tomcat service as root. Try sudo tomcat start instead (assuming that tomcat start is correct); that will run the starter process as root.

It's either that, or you aren't executing what you think you are. Remember that in Linux, you must give the full name of the file you want to execute; tomcat and are distinctly different. This is because unlike on Windows, file extensions in Linux (and other Unixes) are essentially devoid of meaning to the OS.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.