I have a standard user on an Ubuntu 22.04 Desktop VM named "user1". The VM is running apache2.
I would like user1 to not be able to access the contents of the folder /var/wwww to keep the contents secure. A visitor to the webpage should still be able to access the site as expected.
My attempted solution was
sudo chmod 770 /var/www
thinking that this would prevent user1 from accessing the contents. Well, that worked, but now visiting the webpage produces a "forbidden" error from Apache. Makes sense.
What is the proper way to set these permissions?