Ever faced the issue of having an other environment then your own? If not, get yourself the experience. You can learn from it! :)
But what a hell is it sometimes, tried setting up a drupal 6 project on a hosting account with plesk administration. Luckely with shell access..
First encounter with the plesk-aliens? I want private uploads (with funded reasons) so to give you a heads up on the structure created by the plesk panel.
The http directory (our webfolder)
/var/www/vhosts/drupal6project/httpdocs
The private file directory
/var/www/vhosts/drupal6project/private_files
The TMP directory (maybe obvious..)
/tmp
After confirming this in filesystem settings we get the following error :
The directory /var/www/vhosts/drupal6project/private_files does not exist.
So we double check, triple, quatriple check. C'mon apache. It does exist! So let's investigate..
Possible solutions :
1) directory permissions (chmod)
2) directory owner (chown)
3) drupal issues? Doubt it...
4) php configuration
5) Apache configuration
Since all of these were quite hard to manage in plesk system I dove in to the dark bash...
Look what I found!
/var/www/vhosts/drupal6project/conf
<IfModule mod_php4.c> php_admin_flag engine on php_admin_flag safe_mode on php_admin_value open_basedir "/var/www/vhosts/drupal6project/httpdocs:/tmp" </IfModule> <IfModule mod_php5.c> php_admin_flag engine on php_admin_flag safe_mode on php_admin_value open_basedir "/var/www/vhosts/drupal6project/httpdocs:/tmp" </IfModule>
So just add your folder to the open_basedir directory and it can be found by the webapplication (in our case drupal)
example :
php_admin_value open_basedir "/var/www/vhosts/drupal6project/httpdocs:/tmp:/var/www/vhosts/drupal6project/private_files"
Hmm, after some testing it was still not exactly how we wanted it. Next error? Bring it on!
The script whose uid is 0 is not allowed to access /var/www/vhosts/drupal6project/private_files/59 owned by uid 33 in ...
Since our access permissions are optimal in the server itself and safe_mode is quite obsolete (it will even disappear in PHP6) you can just turn it off.
Update 1 (thanks to sun):
Found an easier way !
Add a vhost.conf file with following data in
/var/www/vhosts/drupal6project/conf :
<Directory /var/www/vhosts/drupal6project/httpdocs/> php_admin_flag safe_mode off php_admin_value open_basedir "/var/www/vhosts/drupal6project/httpdocs:/tmp:/var/www/vhosts/drupal6project/private_files: </Directory>
Execute /usr/local/psa/admin/bin/websrvmng -a to reconfigure plesk.
restart apache and check your website working with plesk and private files
Happy plesking in drupal!








Post new comment