I believe it's a un*x or apache question and it may not have a solution but I still hope to hear someone's opinions :)
When you installed a drupal on a machine with a non-root (or let say, non-www-data) account (ex, installed it under your personal account on a lab machine '~drake'), the whole files/directories are drake:ooxx. As documentation suggested, you create a folder 'files' under ~drake/public-html/ and give it access permissions open to all (chmod 777 files). Everything went fine except one day you gonna remove the drupal or move it to some other places(machines or folders). Then, the question appears:
You don't have permission to delete files under ~drake/public-html/files because all of them were created by www-data or some acount that web server runs as.
Does anyone have any good solution to this issue? The quickest way is call webadmin to help you remove those files/directories. and I am thinking is there some configuration way to tell apache when it is creating some files/directories under ~drake/public-html/files, make them 777 but 755 or 644.
Is it possible to do that in apache with just a .htaccess ?
Thx :)
Comments
Change the permissions via php
When/if you need access to those forbidden directories, it's an easy fix ...
Just create a small php file in your drupal root directory containing this:
Point your browser to that file, and you should now have necessary permissions to do whatever you need to do. It shouldn't affect Drupal's performance at all.
Note that once you see the directory structure, you'll probably need to repeat the process for all subdirectories under "files" as well:
Also, you can experiment with the permissions that work on your server ... 775 is what worked for me.
(Just be sure to delete that php file when you're done. That could be a dangerous thing to leave lying around.)
wow, interesting
I think I can write up a php script to recursively chmod or even unlink(or remove) files~
good tips
although it's very dangerous :)
thx a lot
You can start fro here
This is some code I found on http://php.net - just search for chmod and this snippet comes up
I have never run it - or even tested it - but this is a start.
Paddy.
http://deburca.org, and http://amadain.net
Paddy.
http://deburca.org
or...
If you have some kind of cpanel, you can use it to delete anything under your username path.
Alexandre Racine
www.gardienvirtuel.com Sécurité informatique, conformité, consultation, etc
www.salsamontreal.com La référence salsa à Montréal
thx a lot
thx a lot
I think I got what I need :)