Dave Kopecek bio photo

Dave Kopecek

The Blog That Time Forgot.

Email Twitter Facebook LinkedIn Instagram BitBucket Github Stackoverflow Pinterest

Ubercart is a a popular shopping cart plug-in for the popular Drupal Content Management system. Parallel’s Plesk is a popular hosting control panel.

When configuring a Drupal-Ubercart install on a Plesk based host Ubercart requires the creation of a /keys directory that is outside of your document root (aka /httpdocs in Plesk ) To create a keys directory that does not generate open_basedir errors you’ll need to do the following

Log in as root and create or edit conf/vhost.conf and conf/vhost_ssl.conf as shown.

conf/vhost.conf:

<Directory /var/www/vhosts/YOUR-DOMAIN.COM/httpdocs>
php_admin_value open_basedir "/var/www/vhosts/YOUR-DOMAIN.COM/httpdocs:/tmp:/var/www/vhosts/YOUR-DOMAIN.COM/keys"
</Directory>

conf/vhost_ssl.conf:

<Directory /var/www/vhosts/YOUR-DOMAIN.COM/httpdocs/>
php_admin_value open_basedir "/var/www/vhosts/YOUR-DOMAIN.COM/httpdocs:/tmp:/var/www/vhosts/YOUR-DOMAIN-HERE.COM/keys"<
</Directory>

Note that Php_admin_value and all that follows should be on one line.

Then run (on CentOS - Ubuntu/Debian may be slightly different):

/usr/local/psa/admin/sbin/websrvmng -u --vhost-name=<domainname>
/etc/init.d/apache2 restart

After the restart Plesk will include the contents of your file in the apache config file. You can verify that it’s being included by checking httpd.include you should see a line similiar to:

Include /var/www/vhosts/mydomain.com/conf/vhost.conf

Feeling adventurous and want to add other apache directives in the .conf file ? Great, but HEED MY WARNING. If you mess up the syntax in either of the files apache may fail to restart – That would be why you needed to log in as root. Delete-Remove-Rename the .conf files, rerun websrvmng and start apache. No big deal if you’re on a development box, but, as always you would be wise to follow the 2-Beer rule when logging into production boxes as root.

Resources:

Ubercart Keys Documentation Page: http://www.ubercart.org/docs/user/2731/credit_card_settings

Plesk forum and Knowledgebase posts: http://forum.parallels.com/showthread.php?t=84211&highlight=vhost.conf+websrvmng http://kb.parallels.com/en/5464 http://kb.parallels.com/en/432

You may want to check out Power Toys for Plesk from grafxsoftware.com http://www.grafxsoftware.com/product.php?id=172 which includes a vhost conf editing tool.

Of course you can avoid all this by having Aisle8, Inc. host your Drupal, Ubercart or OpenAtrium site. We can host it on a Plesk based server, or one of our trusty Aegir based boxes. Aegir eases the hosting and upgrading Drupal sites — Ain’t nothing else like it around.