• 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!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    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.

How do I give multiple domains read access to a folder outside their own httpdocs?

T

torkild

Guest
Hello! I have tried for some time now to create a folder outside the domain spesific "httpdocs"-folder and leting some domains access it trough php.

The files they are going to access are library-files, who can do no harm at all to the server, and the user is only going to have read-access to this folder.

Lets say the folder is located in the root of the server, f.ex: "/php-libs", and in this folder there are som php-files, among them f.ex: "form-class.php".

So the php-file in the domains httpdocs should be able to
PHP:
include('/php-libs/form-class.php');
and then create a new instance of the form class.

The domains that is allowed to do this has the following in the vhost.conf file:
<Directory /var/www/vhosts/@domain_name@/httpdocs>
php_admin_value open_basedir "/var/www/vhosts/@domain_name@/httpdocs:/tmp:/php-libs"
</Directory>

The big question I guess is: What permissions should I give the "php-libs" folder? What user and what group should I set up?
 
i dunno

I don't know the specific answer to your question but I was trying to solve a similar problem (executing PEAR library includes outside of the web root folder) and basically cobbled together a solution based on the error messages I was receiving from my script--I ended up turning off php's safe mode and also adding the path to the directory you want to use to php's open_basedir environment variable. I don't recall setting the linux file permissions to anything in particular to make it work.
 
Back
Top