I am a web application developer, just a beginner.
I am designing a small J2EE web application (for example, the service name would be like http://www.example.com). It uses Apache Tomcat.
Spec: When a user sign up into the web application, he will get a custom domain like
How can i accomplish this in my web application. I am still developing the app. i have not hosted it yet.
You’ll need to create a virtual host for each subdomain in Apache configuration like:
There is one problem though. If your solution requires folders creation, virtual host addition and apache restarts which does not look good to me. How would I deal with this problem is:
If you use this way, you only need to setup the above once and then add the subdomains in to the storage which appears to be more flexible solution than creating subfolders and modifying Apache configuration.