PHP Safe Mode & Directory Permissions

Discussion in 'General' started by domino, Aug 23, 2005.

  1. domino

    domino New Member

    I have 2 questions.

    1. Why did it automatically set Safe mode ON, on all my Virtual Servers?
    2. Why are the directories default CHMOD 775 and files CHMOD 664?

    I'm a bit paranoid about the chmod values. How can I change to CHMOD 755 for folders and CHMOD 644 for files when I create a new Virtual Servers?
  2. falko

    falko Super Moderator Howtoforge Staff

    Do you mean that the PHP Safe Mode checkbox is already checked when you create a new web site? Then I guess you've defined a hosting template that has Safe Mode on.
    Otherwise I think you have Safe Mode on in your php.ini.

    That's because under Sendmail procmail recipes aren't executed if the parent directories don't have 775. I think it's different with Postfix, but I'm not 100% sure, so I wouldn't try to change the permissions as your mail delivery might fail afterwards.
  3. domino

    domino New Member

    Yea, thats why. I wasn't paying attention with checking the 3 domain's feature boxes. This is a new box Debian box this time :). Thanks for reminding me that I need thicker glasses.

    I'm using postfix and isn't it a secuiry risk to have the "web" folder with that type of permission? I'm not claiming it is. It's just I'm used to having folder at 755 and files at 644.
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Every web has ist own group and the folder is owned by that group.
  5. domino

    domino New Member

    If no one else objects I'll take your word for it :). It's just that a certain Gallery script will not let me continue the installation unless the "web" permissions are set to 755. :(. So dump the script?
  6. falko

    falko Super Moderator Howtoforge Staff

    You can chmod the web folder to 755. :)
  7. domino

    domino New Member

    I will do that. Is chmod 775 / 664 a requirement for postfix? If no, where can I set the perams for changing it? I want to make it a default 755 folders / 644 files whenever I create an new site in ISPC and upload/create things through FTP client. Is that possible given the current environment and applications installed?
  8. falko

    falko Super Moderator Howtoforge Staff

    You can change the function make docroot() in /root/ispconfig/scripts/lib/config.lib.php. There all chmods are done. :)
  9. domino

    domino New Member

    Thank you for the pointing it out. I have my peice of mind now that my idiot friends and brother can install whatever they like :).

    PS. Oh I sure wished quick reply was enabled on this board :D
  10. hairydog2

    hairydog2 New Member

    It is! Click the button to the right of the Quote button
  11. falko

    falko Super Moderator Howtoforge Staff

    It wasn't enabled when domino posted that. It has been enabled in the meantime. ;)

Share This Page