0

I have existing version of tomcat7 which installed with default apt-get. which is by default running on its own user "tomcat7" On ubuntu 16.

Now I want tomcat9 as well running on same server with different port. I have downloaded tomcat9 manually and extracted in /opt/tomcat9.

It is running fine. But the problem is I am running tomcat9 with "sh /opt/tomcat9/startup.sh" command. which is executing it with root user. And the files which are uploaded earlier are in directory "/var/lib/tomcat7/webapps/images".

And the application which running on tomcat9 is accessing same files and also writing files in same directory. But tomcat7 is not able to access those files since those are created with "root" user. How can I run tomcat9 with same user which tomcat7 uses i.e. 'tomcat7'

  • Set up a docker container, duplicate the files from tomcat7 to docker container tomcat9. Now you avoid all the janky hacky two different user accounts. – Arlion Nov 09 '20 at 15:14
  • Or you could create a common group between 7 and 9, then modify the file perms to allow group access. – Arlion Nov 09 '20 at 15:15

0 Answers0