• 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

vhost.conf and open_basedir strange behavior

ropox

New Pleskian
Hello

before you read this post, bare in mind that i have already browsed the hundreds of posts about open_basedir, and this is not the first time that i setup plesk and open_basedir.

the scenario is the following :

i have a file that through php does ftp to another server and downloads a file to a directory outside web root called _downloadFiles. the file that does the operation is under a folder under the web root.

file permissions are below

drwxrwxrwx 2 userftp psaserv 4096 Oct 8 14:00 _downloadFiles
drwxrwxrwx 17 userftp psaserv 4096 Nov 3 06:39 _uploads
drwxr-x--- 5 userftp psaserv 4096 Oct 8 13:33 anon_ftp
drwxr-xr-x 2 root psaserv 4096 Oct 8 13:33 bin
drwxr-x--- 3 userftp psaserv 4096 Oct 8 13:33 cgi-bin
drwxr-x--- 2 root psaserv 4096 Nov 3 22:04 conf
drwxr-xr-x 2 root psaserv 4096 Oct 8 13:33 error_docs
drwxr-xr-x 14 userftp psaserv 4096 Nov 3 21:02 httpdocs
drwxr-x--- 2 userftp psaserv 4096 Nov 3 17:31 httpsdocs
drwxr-x--- 2 root psaserv 4096 Nov 3 21:18 pd
drwx------ 2 userftp root 4096 Oct 8 13:33 private
dr-xr-x--- 7 root psaserv 4096 Oct 8 13:33 statistics
drwxr-xr-x 2 root psaserv 4096 Oct 8 13:33 subdomains
drwxr-xr-x 2 root psaserv 4096 Oct 8 13:33 web_users



on the vhost.conf i have the following

<Directory /var/www/vhosts/domain.com/httpdocs>
php_admin_value open_basedir "/var/www/vhosts/domain.com:/tmp:/usr/share/pear:/var/www/vhosts/domain.com/httpdocs:/var/www/vhosts/domain.com/httpsdocs:/var/www/vhosts/domain.com/_uploads:/var/www/vhosts/domain.com/_downloadFiles"

php_value upload_max_filesize 5M
php_value max_execution_time 10000
php_value post_max_size 22M

php_value auto_prepend_file "fileauto.php"

</Directory>

i have changed and experimented with all possible variations of the vhost.conf file and after each and every change i did a /usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=domain.com

as well as a /usr/local/psa/admin/sbin/websrvmng -u --vhost-name=domain.com
as well as service httpd restart

and still get the evil error


PHP Warning: ftp_nb_get(): open_basedir restriction in effect. File(/var/www/vhosts/domain.com/_downloadFiles/0e8eca86faea1ba49bf430460a765eaf.jpg) is not within the allowed path(s): (/var/www/vhosts/domain.com/httpdocs:/tmp)

i also have and .htaccess file with the following


php_value include_path ".:/var/www/vhosts/domain.com/httpdocs/core:/var/www/vhosts/domain.com/httpdocs/_inc:/var/www/vhosts/domain.com/httpsdocs/_inc:/var/www/vhosts/domain.com/httpsdocs/core:/var/www/vhosts/domain.com/httpdocs/cms/lib:/var/www/vhosts/domain.com/httpsdocs/cms/lib:/var/www/vhosts/domain.com/httpdocs/cms/Editor/editor:/var/www/vhosts/domain.com/httpsdocs/cms/Editor/editor"


Options All

all files under web root have permissions -rwxr-xr-x. and they are owed by userftp and from group psacln...


i dont understand why would it do this ?????// even when i tried to disable open_basedir all together i still got the same error...

obviously this is a directory outside the web root that i need to access, but why the allowed paths are not changing after i set vhost.conf ??? http.include file has everything correct to include the vhost.conf and vhost_ssl.conf files,
and i'm using

Plesk Control Panel version psa v8.6.0_build86080910.19 os_CentOS 4.2
Operating system Linux 2.6.18-028stab057.4-ent


Could anyone guess what is going on ?????

many thanks in advance to all for just reading this....
 
Back
Top