When you set up lighttpd with the normal ubuntu packages (apt-get install lighttpd
),then ubuntu uses the owner/group www-data and adds this user automatically for you.
In /var/www you can use your username as owner for the files and directories, but change the group to www-data.
sudo chown -R yourusername:www-data /var/www