Ubuntu Server - granting permissions to /var/www

Some of you might fall into this annoyance when freshly installed Linux with Apache2 does not allow you to upload files to www directory. Below is a quick fix. sudo groupadd www sudo useradd -g www sudo chown -R :www /var/www sudo chmod -R g+rwX /var/www sudo chmod g+s /var/www You create a new group, you add a user into this group, you assign the ownership to the new group and you finally ensure that files created in this folder will be owned by the group.