How I set open_basedir for a domain on a Plesk server (9.2.2)

Posted by Streetdaddy™ on September 18th, 2009 filed in Geek

If you’ve gotten here than I’m going to assume you understand the security risks of what we’re doing here.

It took me a few goes as I’m still bumbling my way through Plesk, so I thought I’d share my successful attempt.  Remember to replace <your domain> with, er, your domain…

  1. Open/create vhost.conf:
    vim /var/www/vhosts/<your domain>/conf/vhost.conf
  2. Add the following rules:
    <Directory /var/www/vhosts/<your domain>/httpdocs>
    <IfModule sapi_apache2.c>
    php_admin_value open_basedir "/var/www/vhosts/about-australia.com/httpdocs:/tmp:<directory to open>"
    </IfModule>
    <IfModule mod_php5.c>
    php_admin_value open_basedir "/var/www/vhosts/about-australia.com/httpdocs:/tmp:<directory to open>"
    </IfModule>
    </Directory>
  3. Reload configuration and restart httpd via Plesk:
    /usr/local/psa/admin/sbin/websrvmng --vhost-name=<your domain> -v -r

Hope it works for you…

Leave a Comment

FireStats icon Powered by FireStats