Serving html and php files
I just started hosting files for a website on my server, and I'm not sure where is an appropriate place to keep them to provide access for multiple users.
When I started hosting the site, I put the site files in: /var/www/name.of.virtualhost.site/www/
.
I am deploying directly from a checked out repository, for convenience & simplicity, so to update the website codebase another developer or I only have to check out the latest version of the files in order to have everything up to date (using git, in this case). However, the root of the repository has files that I prefer to be non-public.
Right now that's obviously not the case because anything below the final public /www/ folder is also available on the default domain or ip since the /var/www/ contents are already being served up by default by apache. For example, /var/www/name.of.virtualhost.site/docs/site_policies.txt
is accessible via some url like
defaultsite.com/name.of.virtualhost.site/docs/site_policies.txt
.
So where is a better place to store a website's files on linux?
When it's a site that only I'm developing, I can obviously just stick them in /home/my_username/sites/name.of.virtualhost.site/
, but that doesn't work well when I want other developers to be checking out the repository and sometimes editing the site's files as well. And I'm running a LAMP stack, not that I expect it to matter.