Setting Permissions for Readable Content
Have you ever wanted to have content served up, but it wasn’t readable? Here’s an easy way to recursively set permissions for a web server:
chmod -R a+r ~/www
find ~/www -type d -exec chmod a+x {} \;
Just change ~/www to whatever directory you wish to make readable, and this command will make everything under that directory world-readable and make all directories listable.
Sir Bode Rafael said,
May 13, 2009 at 10:21 pm
Wouldn’t be better suppling the simplistic chmod way, like this?
chmod -R 777 /path/to/directory
Which is equal to:
chmos -R a=rwx /path/to/directory
Regards!
Ben said,
May 16, 2009 at 3:46 pm
That would make everything readable, writable, and executable by everyone. A preferable approach would be to add read permissions only for the web server.