Set up multiple domain names on the Tomcat server in order to increase the usability, efficiency and scalability of your application, as well as save your costs without having to configure separate instances. For this, make some minor adjustments within Tomcat configuration files as described below.
In a minute your environment will be successfully created.
You can buy and set up your own domain names instead of default ones by adding CNAME record or by setting A Records. Read more in the Custom External Domain Name Binding document.
Go back to the platform dashboard, click the Settings button for your environment and bind your domains.
In our example, we’ll use tomcatfirst.tk for the first domain name, and tomcatsecond.tk for the second.
Now you need to deploy the projects.
When the Deploy form appears choose your environment and assign the context (tomcatfirst, in our case). Then press Deploy button.
Then deploy this application to the same environment but with different context, (e.g. tomcatsecond).
When deployment is finished you have two applications deployed in your environment.
Add Host tags for each domain you want to bind:
Note: If you want to redeploy an application to the Tomcat instance with already configured server.xml, you need to comment < Host > block before redeploying and uncomment it afterwards.