JSP script cannot list a directory/upload files into it

Created:

2017-05-02 11:49:08 UTC

Modified:

2017-08-08 13:28:20 UTC

0

Was this article helpful?


Have more questions?

Submit a request

JSP script cannot list a directory/upload files into it

Applicable to:

  • Plesk for Linux

Symptoms

JSP script cannot list a directory or upload any files into it.

Manual listing via CLI returns the following error:

[root@server httpdocs]# sudo -u tomcat ls /var/www/vhosts/example.com/httpdocs/Organisations/AU00000004/Programs/O-00000453
ls: cannot access /var/www/vhosts/example.com/httpdocs/Organisations/AU00000004/Programs/O-00000453: Permission denied

File permissions to the directory are the following:

[root@server httpdocs]# ls -ld /var/www/vhosts/example.com/httpdocs/Organisations/AU00000004/Programs/O-00000453
drwxr-xr--. 4 ekb psacln 4096 May  2 17:16 /var/www/vhosts/example.com/httpdocs/Organisations/AU00000004/Programs/O-00000453


Group membership of the user tomcat is the following:

[root@server httpdocs]# id tomcat
uid=91(tomcat) gid=91(tomcat) groups=91(tomcat)

Cause

User tomcat is not allowed to list the directory/write to the directory.

Resolution

Grant tomcat user required permissions with ACL:

# getfacl -R /var/www/vhosts/example.com/httpdocs/ > /root/permbackup
# setfacl -R -m u:tomcat:rwx /var/www/vhosts/example.com/httpdocs/
Have more questions? Submit a request
Please sign in to leave a comment.