• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.

Is Plesk changing the linux permissions?

R

rfuguet

Guest
Hi!

I'm migrating a website made in PHP to Plesk, and I have some troubles with permissions. Is it possible that Plesk overide the permissions that I put in console? I turned out the safe_mode, but i'm not sure if this is enough.

The file test_server.php:

<?php
echo "Test message";
?>

is in /var/www/vhosts/domain1/httpdocs/path1/test_server.php
and its permissions are: 775 user1 group1

The file test_include.php:

<?php
echo "Starting";
require_once("/var/www/vhosts/domain1/httpdocs/path1/test_server.php");
?>

is in /var/www/vhosts/domain2/httpdocs/path2/test_include.php
and its permissions are: 775 user1 group1

When I execute test_include.php in a browser, I can see "Starting", but not "test message".

When I move test_server.php to the same domain of test_include.php (/var/www/vhosts/domain2/httpdocs/path1/test_server.php) it works.

When I enter by terminal, (user1@domain2) I can access the file without problems when I type:
vi "/var/www/vhosts/domain1/httpdocs/path1/test_server.php"
(user1 is not root)

Finally, some folders in httpdocs have the 755 permissions, but when I type in a browser return "403 Forbidden".

I have read Plesk documentation, and searched centos permissions, but now I'm stuck.

Some clue?

Thanks!
 
Plesk uses PHP's open_basedir setting to restrict PHP scripts to their domain's httpdocs directory (and /tmp) for security. If you check the domain's error_log you'll see that the open_basedir restriction is in effect (or enable display_errors to see errors in your browser, but this is not recommended for production sites).

You can override a domain's open_basedir setting if you want, for instance you can add domain2's path2 directory to domain1's open_basedir like this:

Code:
<Directory /var/www/vhosts/domain1/httpdocs>
php_admin_value open_basedir "/var/www/vhosts/domain1/httpdocs:/tmp:/var/www/vhosts/domain2/httpdocs/path2"
</Directory>

See Including Directives into Web Server Configuration File for instructions on adding custom Apache settings for a domain.
 
Back
Top