• 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

Warning: file_exists(): open_basedir restriction in effect

5

52chevy

Guest
I am having troubles with open_basedir restrictions. Here is the error that I am getting:

Warning: file_exists(): open_basedir restriction in effect. File(/data/www/dev.txt) is not within the allowed path(s): (/home/httpd/vhosts/domain_name_here/httpsdocs:/tmp) in /home/httpd/vhosts/domain_name_here/httpsdocs/include/constants.inc.php on line 20

and here is the contents of the vhost.conf file which should allow what the above is attempting:

<Directory /home/httpd/vhosts/domain_name_here/httpdocs>
php_admin_value open_basedir "/home/:/data/"
</Directory>
<Directory /home/httpd/vhosts/domain_name_here/httpsdocs>
php_admin_value open_basedir "/home/:/data/"
</Directory>

The files in the httpdocs folder work fine...there are the same files in the httpsdocs folder and it gives me the error. I have another server running Plesk 7.0.2 with an identical set up and this works. The server that I am having trouble with is running Plesk 7.5.1. Can anyone tell me the difference between these loads that would make this not work the way old server does? I am at my wits end. Please help!
 
Looks like Apache isen't reading your vhost.conf settings. Have you reconfigured the apache with the websrvmng --vhost-name=<your_domain> after creating the vhost.conf file?

Oh... on the other hand - you should put this:

<Directory /home/httpd/vhosts/domain_name_here/httpsdocs>
php_admin_value open_basedir "/home/:/data/"
</Directory>

seperately in a vhost_ssl.conf file. And reconfigure apache with websrvmng :)
 
I already have the vhost_ssl.conf file as you have stated (sorry for not including that). But have not reconfigured apache with websrvmng. Would that be found in the main httpd.conf file or the one for that domain? Thanks for the help.
 
websrvmng is a util - found in <path_to_psa>/admin/bin/websrvmng

So do a:
websrvmng --vhost-name=<domain_to_change>

and restart apache - then the changes should be in effect.

Else you have to turn to the manual to see the explanation on using custom settings in Apache.
 
How can I tell if the websrvmng --vhost-name=<domain name> has taken effect? I have excecuted the command but see no results. Looks like I am going to the manual...thank you for your help.
 
Look in the httpd.include and see if Plesk has written a Include for the vhost.conf and vhost_ssl.conf files.

Or test and see if your problem has been solved :)
 
There always was a line lincluding the vhost_ssl.conf file for the secure config but it seemed to be ignoring the file. This morning I changed that line to point to the vhost.conf file. Not sure if it is correct but it is working. Thanks for all your help.
 
Originally posted by 52chevy
There always was a line lincluding the vhost_ssl.conf file for the secure config but it seemed to be ignoring the file. This morning I changed that line to point to the vhost.conf file. Not sure if it is correct but it is working. Thanks for all your help.

Hmm... You have to remove the wrong settings from you vhost.conf and put it only in the vhost_ssl.conf - and it has to work if your paths is right and the vhost_ssl.conf include is in httpd.conf.

You have to remember that httpd.conf will be overwritten sometime by Plesk and then it will stop working again.
 
There are no "wrong settings" in the vhost_ssl.conf file. The vhost.conf and vhost_ssl.conf files are identical. That is what it the confusing part about this whole thing!
 
Back
Top