Edit Web Pages

When apache2 is first installed it is not easy to edit the web pages because of ownership and group membership and permissions. This can be solved using the following two commands:

To make yourself belong to the group www-data:

$ sudo usermod -a -G www-data $USER

Log out and back in again. The 'groups' command should now show you as being in www-data.

$ groups

Now make the folders and files belong to USER and to www-data:

$ sudo chown -R $USER:www-data /var/www/html