Applicable to:
- Plesk for Linux
Symptoms
When opening File Manager or a specific directory in File Manager in Plesk at Domains > example.com > Dashboard tab > Files, the page shows the warning:
PLESK_WARN: Unable to open the directory: Symlinks out of webspace are prohibited //httpdocs: Access to realpath denied: /var/www/vhosts/example.com/httpdocs to /var/www/html.
Cause
The directory, which is opened in File Manager, is a symbolic link to a directory that lies outside of the subscription's home directory (/var/www/vhosts/example.com):
# ll /var/www/vhosts/example.com/httpdocs
lrwxrwxrwx. 1 john_doe psaserv 14 Sep 21 09:57 httpdocs -> /var/www/html/
Symbolic links that lead to directories that lie outside of the subscription's home directory are prohibited for security reasons.
Resolution
Apply one of the workarounds:
Solution I:
Replace the symlink with the destination directory.
In the example below, /var/www/vhosts/example.com/httpdocs directory is a symbolic link to /var/www/html/:
- Connect to your Plesk server via SSH.
-
Unlink the
httpdocsdirectory in subscription's home directory:# unlink /var/www/vhosts/example.com/httpdocs
-
Create a new
httpdocsdirectory:# mkdir /var/www/vhosts/example.com/httpdocs
-
Copy all files from the destination directory to
httpdocs:# cp -a /var/www/html/* /var/www/vhosts/example.com/httpdocs
-
Repair file/directory permissions of the subscription:
# plesk repair fs example.com -y
Note: If the destination directory (in this example,
/var/www/html/) is no longer required, it can be safely removed.
Solution II:
In case domain's document root has been moved to another partition and its location has been replaced with a symlink on purpose, mount this partition directly within the path /var/www/vhosts/example.com/ and make sure that it has sufficient permissions and is owned by the subscription system user and psacln group.
Note: This is an administrative task and should be performed by the system administrator/server owner.
Internal example:
First you need to make sure that the contents of the /root/web are owned by the system user of the Plesk Subscription and that sufficient permissions are present.
Afterwards, you need to mount the source directory /root/web to the destination directory /var/www/vhosts/example.com/web (make sure an empty target directory exists), which can be done by executing the following command:
# mount -o bind /root/web /var/www/vhosts/example.com/web
This will make the contents of the /root/web manageable in the /var/www/vhosts/example.com/web path after opening the File Manager as the system user of the Plesk subscription.
Comments
Please sign in to leave a comment.