• 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

Subdomain vhost.conf

P

phibster

Guest
I have been trying to change the open_basedir restriction on a single subdomain to allow a 3rd directory. I have followed the example given here (this is for adding www.subdomain.domain.com but same principle). I created the vhost.conf file in the right folder and placed the following line:

PHP:
php_admin_value open_basedir "/home/httpd/vhosts/domain/subdomains/subdomain/httpdocs:/home/httpd/vhosts/domain/subdomains/secondsubdomain/httpdocs:/tmp"

I then executed /usr/local/psa/admin/sbin/websrvmng -v -a to update the server. I then tested the basedir restriction and it hadn't changed. I restarted the httpd service. Still no go. What am i doing wrong? Is it a case of not being able to reassign that value once it has been set? If so how else can I get around this?
 
You should try something more like this:

<Directory "/home/httpd/vhost/domain.com/httpdocs">
<IfModule sapi_apache2.c>
php_admin_flag engine on
php_admin_value open_basedir "paths_here"
</IfModule>
</Directory>
 
Cheers worker. Worked like a charm. Put that code in, executed the websvrmng command and bing it works.
 
Back
Top