• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Add default path to open_basedir

R

ryanmhubbard

Guest
Is there a way to add a path to the openbase_dir for domains. That way I don't have to keep adding a vhost.conf file for every domain just to add the pear directory?

If this is not possible is there a way to automate the creation of a vhost.conf file in Plesk for a created domain?
 
You can create a conf/vhost.conf file in the skeleton so newly created domains will have the entries ready to go.
 
Thanks. Is there any documenation on this, for example variable names for the file?

Do you know how you would create it so the domain name and directories are inserted properly into the file?
 
Hm yes... There are variables available, but I believe they are not documented anywhere that I know of. I only remember @domain_name@ right now. Maybe that is the only one. Could be enough though?
 
It would be good for top level domains but for subdomains it won't work because they exist in different directories.

Is there a file on the server somewhere that Plesk uses that might have more listed in it?
 
Could you please help and point me to the skeleton files?

I added pear include path into the php.ini file, I then added the path to open_basedir in each httpd.include file, however, I have to set every website to safe_mode = off for this to work, and the httpd.include is rewritten...

Please help
 
Like the the comments in the httpd.include (and this thread) say: do not edit httpd.include. Create a vhost.conf file to add or overwrite settings.

There is a .skel directory in your vhosts directory. You can also check out the documentation that tells you how to use your own skeletons via the Plesk web interface.
 
Hi everyone,

Has anyone had any luck on this?

In my .Skel directory there are no conf files or folders. So I would assume that I Just create a conf folder there, and stick a vhost.conf file in there with my values.

But I am unclear as how to make it dynamic.

Should I just put in the following?

Code:
<VirtualHost Server_IP_Goes_Here:80>
php_admin_value open_basedir  ".:/usr/share/pear:/var/lib/php/session:/var/www/vhosts/@domain_name@/includes:/var/www/vhosts/@domain_name@/httpdocs:/tmp"
</VirtualHost>

Would that be the right way?
 
That looks like manually and statically setting a value, which is not something I like to do as good practice.
 
Yes breun, it does show what it could be, not necesarily what what it should be.

What the contents are is one thing that can be determined on an individual basis, but the variable names for use in skeleton files are what is important and lacking.
 
There is no one way it should be. If that was the case then there would be no need to customize this.

What I meant was that the KB article shows you to use php_admin_flag inside a Directory statement (and not a VirtualHost statement).

It appears it is true that the skeleton variables are not documented, but you already found out about @domain_name@ it seems and I believe that is all you need.
 
Back
Top