1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Open Base DIR

Discussion in 'Plesk for Linux - 8.x and Older' started by rmiinc, Jan 23, 2007.

  1. rmiinc

    rmiinc Guest

    0
     
    This restriction is a default setting with servers using Plesk. The (open_basedir) restriction means your server is limiting our files to a specific folder and no file can be called outside of that folder. If a file within httpdocs tries to access a file in httpsdocs to make it secure we will get the (open_basedir) restriction message because you tried to pull a file outside of the folder you originated from.

    To change this, we need to edit the open_basedir path for both the httpdocs and the httpsdocs folders. Once this is fixed correctly, files within both of these folders will be able to talk to each other without restriction. see below for example of how it should look:

    For httpdocs, the current "open_basedir" setting within PHP is:

    /home/httpd/vhosts/myWebsite.com/httpdocs:/tmp

    It needs to be changed to:
    /home/httpd/vhosts/myWebsite.com/:/tmp

    can anyone lend some advice on how to do this?

    Thanks.
     
  2. breun

    breun Golden Pleskian

    29
     
    Joined:
    Jun 28, 2005
    Messages:
    1,647
    Likes Received:
    0
  3. kieranjones

    kieranjones Guest

    0
     
    Is it possible to change the default setting that Plesk uses for this when it sets up a new domain?
     
  4. breun

    breun Golden Pleskian

    29
     
    Joined:
    Jun 28, 2005
    Messages:
    1,647
    Likes Received:
    0
    You could put a vhost.conf in your skeleton that sets this up.
     
  5. kieranjones

    kieranjones Guest

    0
     
    I'd be interested in solving this open base restriction thing, it's getting in the way of a lot of websites and stuff.

    How exactly would this vhost.conf thing work? I tried it and it didn't seem to work at all.

    Also, what are the implications in terms of security of disabling or modifying this?

    And finally, why is it that it causes a problem sometimes? Even when the website is clearly trying to access a file in it's own vhost directory it brings it up :S
     
  6. breun

    breun Golden Pleskian

    29
     
    Joined:
    Jun 28, 2005
    Messages:
    1,647
    Likes Received:
    0
    http://kb.swsoft.com/article_41_432_en.html

    It works perfectly AFAIK.

    open_basedir is a security measure. PHP scripts can never operate outside its open_basedir path. Disabling open_basedir allows scripts to operate on all locations. Of course basic Unix file ownership and permissions are still in effect. When you modify a domain's open_basedir path make sure you only add directories that you know scripts should be able to access.

    Sometimes a web app is written to have files outside the default document root (httpdocs), so you'll need to add those locations to the default open_basedir.

    That shouldn't happen.
     
  7. kieranjones

    kieranjones Guest

    0
     
    Thanks for the detailed reply, I'll act on what you've suggested and let you know. Cheers!
     
  8. kieranjones

    kieranjones Guest

    0
     
    Right,

    I created the vhost.conf file as that article you linked too said and restarted Apache and it still brings up the error.

    It's trying to access a file in the httpdocs folder so I don't understand why it would get this restriction seeing as it's in the right place. It makes no sense too me.

    I'm creating this for a sub-domain, should this be in the subdomains conf folder or the main domain conf folder?

    I've only tried the main domain conf folder.

    Cheers for your help.
     
  9. breun

    breun Golden Pleskian

    29
     
    Joined:
    Jun 28, 2005
    Messages:
    1,647
    Likes Received:
    0
    Can you post the open_basedir as reported by phpinfo(); in the dir of the script and the error message?
     
  10. blank_page

    blank_page Regular Pleskian

    24
    53%
    Joined:
    Dec 17, 2006
    Messages:
    229
    Likes Received:
    0
    Hello,


    If you need for the subdomain then you should put of course under the subdomains conf.
    Then run websrvmng, followed by apache restart.
     
  11. bobjones

    bobjones Guest

    0
     
    fixed!

    Hi kieranjones! (i'm adding you to my "buddies" as we seem to keep having the same problems)

    http://bugs.php.net/bug.php?id=22220 taught me to try the value none (instead of "") to unset the value. Apearantly that doesnt work for some, but it works for me, so this is MY end of research for this issue. Give it a shot and let me know if it doesnt work for anyone, as I assume we all use the same apache/php...

    My /var/www/vhosts/mycompany.com/subdomains/subdomain_name/conf/vhost.conf (for a "single directory for housing SSL and non-SSL content" subdomain) is as follows:
    Code:
    <Directory /var/www/vhosts/mycompany.com/subdomains/[i]subdomain_name[/i]/httpdocs>
            php_admin_value open_basedir none
    </Directory>
    After I set this, I ran:
    Code:
    /usr/local/psa/admin/sbin/websrvmng -v -a
    and phpinfo(); now shows open_basedir no value.

    Maybe-not-so-obviously I have cleverly replaced my real information with the examples 'mycompany.com' and 'subdomain_name' so substitute these for your real information.

    Additionally, you may need to be using vhost_ssl.conf instead of vhost.conf. This does not apply to me, but may to you as mentioned here: http://kb.swsoft.com/article_41_432_en.html
     
Loading...