• 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

open_basedir for subdomain

T

tom1502

Guest
Hi,

how do i set open_basedir restrictions for subdomains?
i have been writing a vhost.conf and put it into the conf directory of the subdomain, and rebooted the whole server, because i dont know the command to make the vhosts.conf active, but nothing changed.
What have i done wrong?!?!

Thx

Thomas
 
RTFM?

Hint: <path_to_psa>/admin/bin/websrvmgr --vhost-name=<the main domain of your subdomain>

:)
 
This is the most recent topic I can find that deals with this, so here I am. Disclaimer: I'm pretty n00b to server management.

I am running on a godaddy virtual dedicated server using plesk 7.5.2.

I wish to disable open_basedir on a subdomain.

I have created the vhost.conf file in my subdomain's /conf directory and added the appropriate rule as outlined in detail in several posts here and elsewhere.

I have run websrvmng and confirmed that the include line is present in the subdomain's virtual host directive in the httpd.include file for the domain.

All the paths seem correct.

I still get the "open_basedir in effect" errors when I run my php script.

I don't suppose there are any known issues with this? Needless to say, I am very frustrated.

EDIT:
Here's the contents of my vhosts.conf file:
Code:
<Directory /home/httpd/vhosts/allanh.org/subdomains/weblog/httpdocs/>

php_admin_value open_basedir none

</Directory>

So after doing all of the above, I get this error:

Warning: open_basedir restriction in effect. File is in wrong directory in Unknown on line 0

Warning: Failed opening '/home/httpd/vhosts/allanh.org/subdomains/weblog/httpdocs/index.php' for inclusion (include_path='.:/usr/share/pear') in Unknown on line 0

On every page I try to load suddomain-wide :(

Once I remove the php_admin_value line from the vhost.conf file, everything returns to "normal".

I am SO confused. Any help would be greatly appreciated.

Sleep time for me.

Cheers!
 
allanh - Try the following in the vhost.conf file for the MAIN domain conf directory:

<Directory /home/httpd/vhosts/allanh.org/subdomains/weblog/httpdocs>
php_admin_flag engine on
php_admin_value open_basedir none
</Directory>

Although it is better to specify the directories you wish to allow, rather than removing the restriction by using 'none'.

Notice there is no '/' at the end of the <Directory ... > line.

And don't forget to run:
/usr/local/psa/admin/bin/websrvmng -a -v

and restart apache.

If you prefer to just reconfigure the one domain, use Whistler's post above as a reference.
 
Wow! Thanks for the super-fast reply :D

I know I really shouldn't have edited my first post so long after posting it. Won't do that again.

I've redone my vhost.conf file as you outlined above to the spacing, but now I get this:

Warning: open_basedir restriction in effect. File is in wrong directory in Unknown on line 0

Warning: Failed opening '/home/httpd/vhosts/allanh.org/subdomains/weblog/httpdocs/index.php' for inclusion (include_path='.:/usr/share/pear') in Unknown on line 0

Even for the index page and any other pages I try to load :(

Thanks again!!
 
Actually the blank lines have nothing to do with it. Did you remove the trailing '/' ??

And you are NOT using a Windows editor to modify the file are you?

I also modified my post above. Try putting it into the MAIN domain's vhost.conf file to see if that helps. Again, I do NOT recommend using 'none', it is better to put the exact paths which you need to allow, rather than removing the restriction altogether.

php_admin_value open_basedir /home/httpd/vhosts/allanh.org/subdomains:/tmp:/usr/share/pear

or

php_admin_value open_basedir /home/httpd/vhosts/allanh.org/httpdocs:/tmp:/usr/share/pear

or

php_admin_value open_basedir /home/httpd/vhosts/allanh.org:/tmp:/usr/share/pear
 
Should I be deleting the vhost.conf from the subdomain directory? I did that and now I get this:

Warning: open_basedir restriction in effect. File is in wrong directory in /home/httpd/vhosts/allanh.org/subdomains/weblog/httpdocs/wp-content/plugins/falbum/falbum-plugin.php on line 45

Fatal error: Cannot instantiate non-existent class: cachedfilereader in /home/httpd/vhosts/allanh.org/subdomains/weblog/httpdocs/wp-includes/wp-l10n.php on line 72

I definitely didn't edit any of the wordpress files.

Many thanks.
 
hang on, I didn't see your second post. Lemme play with that.

And no, I'm on OSX using VIM to edit the files though SSH :)
 
Yes, I removed the trailing slash.

And I'm the only one on my server and I'd rather just disable the restriction once and for all since I've run into this now with a couple of plug-ins I'd like to use and it's more of a pita than it's worth IMHO :) Thanks for the warnings though.

Still need to try the lines from your second post ...
 
Still have the above "Cannot instantiate" error on all pages after trying all three lines above.

To make matters worse, I can't seem to get it back to normal by deleting the files anymore :(
 
I manually removed the offending plugin file and got my site back :) I'm done for the night. It's 3:33AM where I am (Victoria BC) and I've been working on this for 4 hours now, so it's definitely time to sleep and get back to this tomorrow.

Thanks a ton for your help jamesyeeoc :D
 
*bump* - anyone? I've tried virtually everything to get this working, but all anything seems to do is bugger everything up.

Is there possibly an issue with the "virtual" part of my virtual dedicated server?
 
Back
Top