Ubuntu Server 20.04
Hi there, I am trying to setup Virtualmin so I can create websites for students to learn html etc with. I have the server up and running but have a few questions to make this easier to administrate.
- I am creating subsites for the students, so they are like studenta.myserver.com
- I create a user account for them, say student and grant them ftp permissions
- The site and the user get created, but the index.html in the site is not owned by them so it needs to be removed before they can upload their html file.Any way to change this for them when the site is created / or the user is created for the site?
- Is there anyway I can automate all this, via script? Create the user and the site and set the permissions etc programmatically instead of doing each site manually in the interface? I will have to create 30 sites every month for now, but this will probably spread to all schools soon enough and it will become 200+ sites and users a month I am creating. I don’t want to do all that if I can just run a script
First off, welcome to the Virtualmin forums!
The best way to accomplish “complete” isolation between student subdomains (ex. studenta.myserver.com) is to set each subdomain up as it’s own “top-level” virtual server.
This will create its own home directory of “/home/username” where that that student will own everything they upload and other students will not be able to tamper with their content.
If you are hosting DNS locally, it will also create a separate “zone” for each subdomain, but don’t worry DNS is intelligent that way, it will work as expected, but again will provide isolation between students.
I hope this helps, but if you require further assistance feel free to PM me and I’d be happy to offer further direction and advice.
Peter Knowles | TPN Solutions
*** Need Professional, Affordable Technical Support? Visit https://tpnassist.com ***
OMG, that’s exactly what I did last month at niht.students.net.in to host over 500 WordPress websites for students of a digital marketing training institute!
I differ from you in this: I did not create a user account. I did what @tpnsolutions recommends and created a virtual server for each domain / student. This method gives the student / user the ownership of the index.html file and sidesteps the issue you are experiencing with ownerships and permissions.
In my quest to get Virtualmin tweaked to let the training institute create 500+ accounts quickly and to get a server with relatively modest specs to host so many websites, I have designed a workflow for the institute and made some customisation to Virtualmin. I have sent you a private message in case you wish that I do this for you too, as a professional service.
However, please be aware that there are many helpful folk in the Virtualmin community who are good enough to assist free of charge to get you where you want to go with Virtualmin without your needing to hire a pro.
Thanks Peter for the welcome. I will take a look at this.
Thanks Calport. I will take a look at this. I post back if I have any further questions or information that can help others. I have found the API, quite powerful and it might help me batch the setup of this out quicker.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.