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