• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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