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

How to create directory outside of httpdocs?

Discussion in 'Plesk for Linux - 8.x and Older' started by sparkybarkalot, Mar 22, 2005.

  1. sparkybarkalot

    sparkybarkalot Guest

    0
     
    I'm new to Plesk, and a bit new to Linux, so I hope this isn't a silly question. I like to have certain files (password includes, php includes, etc) be one directory up from my web accessible directory (in this case httpdocs). I can't seem to be able to create a directory there... i'm getting errors saying I dont have permissions to run mkdir. Anyone have any ideas how I can create a directory one up from my httpdocs directory, and how to make that directory accessible to PHP scripts running in httpdocs? Thanks very much.
     
  2. BoXie

    BoXie Guest

    0
     
    Well .. you'll need root-access on your server to change the permissions set on the parent directory.

    But i wouldn't recommend to change the default file settings.
     
  3. sparkybarkalot

    sparkybarkalot Guest

    0
     
    Thanks for the reply. I was under the impression that if I created a directory with root then it wouldn't be readable by the web server user. It sounds like you think it will work (even though you don't recommend it) so I'll give it a try. Thanks again.
     
  4. BoXie

    BoXie Guest

    0
     
    By default it won't be readable by Apache webserver ... that's why you will have to 'chown' it (change ownership).

    So as root you could do:

    #mkdir newdirectory
    #chown yourftpusername:psaserv newdirectory
    #chmod 750 newdirectory

    That should do it.

    But it's not recommended i think .. i'm not sure whether this stuff will be backed up or will exist after a Plesk update.

    Goodluck
     
  5. sparkybarkalot

    sparkybarkalot Guest

    0
     
    Thanks a mint BoXie. That not only answers this question, but finally sheds light on setting ownership, which I've wondered about for a while. I owe you one.
     
  6. booker

    booker Guest

    0
     
    I have also been wondering how to create a new directory outside my httpdocs directory. Thank you for clearing that up !

    I still have a problem though. Although I've created the directory and set the ownership and group, I am unable to access that directory using my php scripts. I can ftp to the directory fine, but I need to access it using my scripts (such as uploading a file to that directory, from a web page).

    Any help would be appreciated. I've searched these forums with a variety of keywords, but haven't met with any success on this problem.
     
  7. BoXie

    BoXie Guest

    0
     
    Might be impossible by default .. because Plesk sets an Open Basedir directive in your http config files.

    You'll have to modify it yourself.
     
  8. booker

    booker Guest

    0
     
    Sorry for sounding like a newbie... but would removing that setting be okay? Or do I need to change it to something else?

    I do have root access, but this is the first time I've ever had this level of access to a server, so I don't know everything there is to know about this... (I'm working on it though!)
     
  9. BoXie

    BoXie Guest

    0
     
    Well .. you could add another directory to it ... it defaults to /tmp and /httpdocs i guess.

    But do not mess with it too much .. it can make the whole thing insecure ..

    So you'd better add a specific directory .. than remove the existing ones.

    For more info .. check the php manual.
     
  10. booker

    booker Guest

    0
     
    Thanks alot Boxie. I'll take a look around the web for more details about that setting
     
Loading...