How do I install Tomcat on Linux without getting "permission denied" errors?

Luigi Viggiano

This can happen if the user that you are using to start tomcat does not have permission to read/write some files (example logs). [Look into the Unix commands chmod and chown -- a basic Unix admin class or tutorial would be a great investment at this stage! -Alex]

I can tell you a common solution of installing servers programs with linux:

It's common to create a user (example "tomcat") and install the software using this user.
So, the "tomcat" user will have permission to read/write all the tomcat_home directory (also logs dir, lib etc...), after installing, you'll need to use the "tomcat" user to start the service.

An alternative could be to use the root account to install, and run tomcat, but it can compromise security of the system. [See Can Tomcat be started as a user other than root un... for an alternative and issues around running Tomcat as root or as a different user. - Alex]

To create a new user, you can use "useradd" command. I use to create a directory un /usr/local/tomcat then with root account I change the owner to the new user "tomcat" (chown command). After, with root account you can switch the user (using "su tomcat" command) to install tomcat and in future you can use the user "tomcat" to run the server.

0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact