I am using the wonderful hestia control panel for the development purposes. So I not to forget to change robots.txt each time I create a copy of a site. I would like to automate this somehow. More to that, I do not want accidentally commit those temporary changes in git.
Putting all the sites under a basic auth protection would work. But doing it manually is the same thing as robots.txt. Is there a way to automatically protect all the newly created sites (for all users or for a user) with apache basic auth (with default login/password)?
Now, evey time you create a new web site using Apache’s default template, it will add auth to the web site using your user as default user and ChangeMe as password (remember to replace ChangeMe inside the script).
But, as I understand, that creates .htaccess file in doc root. I usually already have that kind of file in the projects I am working with. I was hoping to set basic auth through apache config, not with a file in a docroot (which would get into git changes). Can I automatically have it in VirtialHost or somewhere like that? Or maybe close the whole server altogether?
As I said, that was an example, if you have other needs you should do it in another way. In your case you should clone default templates (tpl and stpl) with another name (so it won’t get overrided in future upgrades) and do the modifications in those templates.
Thanks for the wise answers! I’ve ended up putting my Hestia behind Nginx Proxy Manger. I’ve configured basic auth for all my dev sites (which are all subdomains of the same domain) there.