Default owner for public_html folder after creating virtualserver?


When I create a virtualserver I would like to set the public_html permissions by default to the user ‘website’.
This because I have added the user website to the apache group and I would like to use this one for apache / webserver operations and filetransfers.

I have set website option to run as apache (mod_php). However, I know reset the ownership for public_html to website user myself, because we can`t do website operations if the user is not website.

Can I control this? And if not, could I create a virtualserver, reset the public_hml ownership manually one time and then clone this vs for every next server?


There isn’t a way within Virtualmin to automatically change the owner’s of files and directories within a Virtual Server.

However, you could make it so that any time a Virtual Server is created, the owner is added into a particular group.

If that would help, you can configure that in System Settings -> Server Templates -> Default -> Administrative User, and there, set your desired group in “Add domain owners to secondary group”.


Hi Eric,

Thanks for your help! Ok, so if I would add it to the apache group, then there is no need to change the directory to my own user right?

Only thing is, in that case I would need to SFTP via the owner for every site. More convenient would be for me to have one apache user and do all FTP operations with that user.

How is this generally setup? I now have the website user which is added to apache group and with that user I do all SFTP operations. I have 5 websites on one VPS so it is ideal to do all website operations from one user. But at the moment for every new site I install I have to reset owner rights of the websites public_html or else I cannot place files.

BTW: the default owner for public_html of all servers I create is the owner of the main virtualserver. I work with one main virtualserver which acts as parent and as mailserver, then I create subservers for every domain / website. Would my problem be solved if I add the ‘website’ user to the main virtualserver owner group?