[SLUG] Writing to /var/www/html

Stephen O'Neill soneill84 at yahoo.co.uk
Sat Jun 2 09:19:30 BST 2007


Hi guys,

I have what I hope will be really stupid question but I can't quite 
figure it out.

Whenever I create a normal file I give permissions of 644 by default. 
This is fine.

However, I am a web developer and write to /var/www/html all the time. 
The problem here is that apache runs as www-data and needs write 
permission and additionally I need write to the files it creates (cache 
files for example).

I have been working around this by putting myself in the www-data group 
and periodically doing:

chown -R www-data.www-data /var/www/html
chmod -R 774 /var/www/html

But there must be a better way? I could put www-data in my group but 
apart from that being insecure I can't see how I can automatically make 
files in a single directory 774 by default.

Is anyone else on the list doing this? And how are they working with it? 
Please make me feel thick!

Cheers,

Steve O




More information about the Scarborough mailing list