Possible duplicate of this but answer is not accepted.
I have 2 scenarios
- We are building a CRM and we will be having multiple clients using same product. Lets take a example,
subdomain1.maindomain1.com
andanysubmain.anothermaindomain.com
should be pointed to same webapp folder. And depending on domain, we will select database dynamically but codebase will remain same. Point to note here : Whole codebase remains same. - We are building series of website for a client where part of the codebase will remain same for all but depending on subdomain we will load the default servlet file. Lets take example,
manage.domain.com
crm.domain.com
equote.domain.com
should be pointing to same webapp folder. And depending on domain we will load default servlet file. Point to note here : Part of codebase will remain same for all domains. Ex. core architect files.
What solutions other have suggested
- Deploy copy of same war file 2 time, Softlink, Create 2 contexts that point to the same file, Use alias. Last one can be good option but no idea how we can use this for different subdomains / domains.
- This can be one of the solution but not sure whether it will work on same port or different port
- There are many articles over internet which shows how we can deploy multiple webapps on multiple domain on single tomcat server but not the way i need.
Note: I can create 2 AWS EC2 instances for above 2 scenarios. It means that I am not expecting one solution to above 2 problems.