Product:
Search Type:

How do I allow writing to domains 'httpdocs' folder for a Tomcat application?

Article ID: 5394 
Last Review: Jul,02 2008
APPLIES TO:
  • Plesk for Linux/Unix

SYMPTOMS

Tomcat Web Application needs to write into domains' httpdocs folder but get the permission denied exception.

RESOLUTION

- allow read/write operation on the domain's httpdocs folder for Tomcat application by editing catalina.policy as descried in the corresponded article. For the 'app' application and the 'domain.com' domain it will be:

grant codeBase "jar:file:${catalina.home}/work/PSA/domain.com/app/-" {
    permission java.io.FilePermission "/var/www/vhosts/domain.com/httpdocs" "read,write";
}


- restart Tomcat

- add the system user that is used by Tomcat service into 'psaserv' group. The user name can be found in the main Tomcat configuration file:

# grep TOMCAT_USER  /etc/tomcat*/tomcat*.conf
TOMCAT_USER="tomcat"
# usermod  -G psaserv tomcat


- allow 'psaserv' group to write into domains' httpdocs:

# chmod 770 /var/www/vhosts/domain.com/httpdocs

Please provide feedback on this article

Did this article help you solve your issue?
Yes
No
Partially
I do not know yet
 
Strongly Agree   Strongly Disagree
  9 8 7 6 5 4 3 2 1
The article is easy to understand
The article is accurate
Additional Comments:
*Please provide us with your email address in case we need to contact you.
*Please type the code you can see.
* - required fields