Installed Tomcat via apt-get

The / usr / share / tomcat8 folder has permissions

drwxr-xr-x 5 root root tomcat8

Inside, respectively, the same. Running Tomcat

$ $ CATALINA_HOME / bin / catalina.sh start Using CATALINA_BASE: / usr / share / tomcat8 / Using CATALINA_HOME: / usr / share / tomcat8 / Using CATALINA_TMPDIR: / usr / share / tomcat8 // temp Using JRE_HOME: / usr / lib / jvm / java-8-openjdk-amd64 Using CLASSPATH:
/usr/share/tomcat8//bin/bootstrap.jar:/usr/share/tomcat8//bin/tomcat-juli.jar touch: unable to touch
'/usr/share/tomcat8//logs/catalina.out': Access Denied
/usr/share/tomcat8//bin/catalina.sh: 401: /usr/share/tomcat8//bin/catalina.sh: cannot create
/usr/share/tomcat8//logs/catalina.out: Permission denied

Looked at different instructions, it is necessary to change the type of user

In one instruction so:

sudo chown -R tomcat8: tomcat8 / usr / share / tomcat8 / logs
sudo chmod -R u + rw / usr / share / tomcat8 / logs

in another way:

udo chgrp -R tomcat8 / etc / tomcat8
sudo chmod -R g + w / etc / tomcat8

How should it even be, from whom to run the process and what rights to the folders?

/ usr / share / tomcat8
/ var / lib / tomcat8
/ var / log / tomcat8
/ etc / tomcat8

  • manipulations with permissions to files / directories inside the /usr directory are definitely not needed and harmful. regardless of what you put there and run. - aleksandr barakin
  • The problem is not only who owns the folder, but also who launches catalina.sh, you need to bring these permissions into conformity, the initiator must have the appropriate rights to write to the necessary directories, now they do not seem to exist. - V. Makhnutin
  • tomcat.apache.org/tomcat-8.0-doc/security-howto.html here is an excerpt from the manual, Tomcat should not be run under the root user. For the operating system. For example, it should not be possible to log on remotely using the Tomcat user. It is not clear how, for example, tomcat8 will give the user the privilege to write logs if he receives only write rights. - Sergei R

0