I have a 2 core, 2 GB RAM VPS with a dedicated IP address from Digital Ocean for my project. I'm using nginx as a webserver, MySQL as a database server and bind as a DNS server.
My project is a free hosting platform for educational purposes. I'll be teaching PHP and MySQL to students from my neighborhood and I want them to practice on their own subdomain with a PHP and MySQL support.
For example, if my main domain name is example.com
, I'll also setup a wildcard SSL for my domain, and student subdomains should be like student1.example.com
.
Students will be able to activate their web space with the subdomain they choose automatically using my setup script which is written in PHP.
How can I achieve what I want without using any web administration control panels? How can any subdomain which is choosen by a student resolve my main domain?
Can students use their own TLD domain on a setup like this?
Do you have any suggestions for this kind of setup?