yungbloodreborn Posted February 14, 2011 Share Posted February 14, 2011 I'm having a permissions problem that I don't quite understand. I have a dir called "games" on my web server owned by kevin:apache. with 0775 permissions. I have a php script create a dir called "games/kaboom". It gains the owner of apache:apache, and permissions of 0755. And I can't seem to create anything inside of "games/kaboom". I've tried explicitly setting owner & permissions, but it seems to be ignored. Is there anything I can do to create stuff deeper in "games/kaboom" ?? Quote Link to comment Share on other sites More sharing options...
trq Posted February 14, 2011 Share Posted February 14, 2011 Set the users sticky bit on the games directory. Quote Link to comment Share on other sites More sharing options...
yungbloodreborn Posted February 15, 2011 Author Share Posted February 15, 2011 Did I do this correctly? I wiped out the dir: rm -rf games Then I did: mkdir games chown kevin:apache games chmod 7775 games But it still creates files with owner of apache:apache... I'm sure I missing something. Quote Link to comment Share on other sites More sharing options...
n3r0x Posted March 4, 2011 Share Posted March 4, 2011 try chown -R kevin:apache games -R Descends directories recursively, changing the ownership for each file. When a symbolic link is encountered and the link points to a directory, the ownership of that directory is changed but the directory is not further transversed. for more information abut chown http://nersp.nerdc.ufl.edu/~dicke3/nerspcs/chown.html Quote Link to comment Share on other sites More sharing options...
yungbloodreborn Posted March 4, 2011 Author Share Posted March 4, 2011 I know about the -R. I'm creating a directory and setting the owner/permissions. There is nothing in the dir yet. So what purpose would the -R serve? Quote Link to comment Share on other sites More sharing options...
yungbloodreborn Posted March 4, 2011 Author Share Posted March 4, 2011 I would still like an answer on this... But for this project I've decided to use another method. Since my purpose was just to unzip a file that I've uploaded to the server, I've decided to just use a cron job search for .zip files in the games folder, and have the cron job do the unzipping. Quote Link to comment Share on other sites More sharing options...
n3r0x Posted March 4, 2011 Share Posted March 4, 2011 I always use -R for empty dirs.. files in them are created with the same owner by apache.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.