8

I've just successfully installed lighttpd, but I've stumbled at the first stage when trying to create my own HTML file. I try to write to /var/www but I get permission denied. I've got a feeling it's to do with the ownership of /var (root:root), but I don't want to change this as there are plenty of other sub-directories in there besides www.

Ownership:
/var root:root
/var/www www-data:www-data

My user pi is also in the www-data group. How can I sort this out?

Edit

pi@Sun:~$ ls -la /var/www   
total 12   
drwxr-xr-x  2 www-data www-data 4096 Jul 20 19:23 .  
drwxr-xr-x 14 root     root     4096 Jul 20 19:23 ..  
-rw-r--r--  1 www-data www-data 3585 Jul 20 19:23 index.lighttpd.html  
Mark Ingram
  • 889
  • 3
  • 11
  • 18

1 Answers1

7

So, www-data is the owner and owning group of /var/www. That doesn't mean anyone in the www-data group can write to /var/www.

You still need to give them write access:

sudo chmod g+w /var/www
Oliver Salzburg
  • 1,794
  • 1
  • 19
  • 33