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

Directory under /httpdocs

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

  1. lpittman

    lpittman Guest

    0
     
    Howdy!

    I'd like to create a folder below /httpdocs for files like database includes (which hold passwords) so it is not accessible by the public, but still accessible by php. I know this is possible, but can't remember how I do it (something with the vhost.conf?) ... any guidance would be appreciated!

    Thanks,
    Luke
     
  2. Whistler

    Whistler Guest

    0
     
    Use a .htaccess file?

    Deny from All
     
  3. breun

    breun Golden Pleskian

    29
     
    Joined:
    Jun 28, 2005
    Messages:
    1,647
    Likes Received:
    0
    I think you'll want to create a directory in the user's home (not httpdocs, but up one level so it's not web accessible in any way) and add that directory to the open_basedir path (see http://kb.swsoft.com/article_41_432_en.html) so PHP can access the files.
     
  4. dericknwq

    dericknwq Guest

    0
     
    Just to be on topic, how can I allow the domain user to create a folder one level below httpdocs? It seems to have permissions problem.

    By default if you created domain.com in Plesk, the user will not have permission to write into /var/www/vhosts/domain.com unless I think if you explicitly use root to chown the dir to the user, it should work. But then again, what should be the correct way of doing such things. I am pretty confuse by what Plesk can help administrators. The documentation are only useful for the admin control panel.
     
  5. breun

    breun Golden Pleskian

    29
     
    Joined:
    Jun 28, 2005
    Messages:
    1,647
    Likes Received:
    0
    A client can't just do this. Login as root, create the directory and use chown to set the client as the owner (and you'll probably want to add this dir to the open_basedir path if PHP is in the mix).
     
  6. dericknwq

    dericknwq Guest

    0
     
    Hmm, what effect will there be if i chown the vhosts/domain.com to the domain user? Will it be too insecure?

    As for the open_basedir, where can I put the php_admin_value if I wish to apply to the whole server? instead of just in a vhost.conf? I just read that you can put in as a skel. But how about just one file which will affect all sites?
     
  7. breun

    breun Golden Pleskian

    29
     
    Joined:
    Jun 28, 2005
    Messages:
    1,647
    Likes Received:
    0
    Setting a global open_basedir path won't work because the domain specific open_basedir entries (in httpd.include or optional ones in a vhost.conf) will override the global open_basedir setting.
     
  8. dericknwq

    dericknwq Guest

    0
     
    Hmm, ok! I got it. Thanks!
     
Loading...