I want to create a system which works using a system like wordpress.com, where each registered user has his own subdomain and (possibly also) his own database.
Sounds like you are looking for some sort of control panel, like cPanel or ISPConfig. Tools like those allow you to provision various resources (like databases and subdomains) for customers. There are probably other more lightweight frameworks out there that could do what you need with less overhead, so you’ll really just have to do your research and find out what would be best for your specific situation.
There are lots of good tutorials on howtoforge.com regarding setting up LAMP stacks with control panels, so I would check there to see if they have a tutorial for the OS you want and the specific tools you need. =)