Multiple Domains in Jelastic: Part II

| October 23, 2012

We've already told you about the benefits of having multiple domains and how to set up multiple domains in Jelastic using Public IPv4 in previous posts. A quick summary: using multiple domains gives you the possibility to increase the usability, efficiency and scalability of your application and of course to save your costs without having to setup separate instances.

Here's another way to do the same thing, but in a little bit different manner. To be exact ,we'll show you how to realize multiple domains setting at the http headers' layer using header Host.

Let's get started!

Set Up Multiple Domains

1. Go to and sign up if you haven't done it yet or log in with your Jelastic credentials by clicking the Sign In link on the page.

2. While in Jelastic dashboard, click the Create environment button:

3. In the Environment Topology dialog, pick your application server (for example, Tomcat 7) and type your environment name, for example, multibinding. Then click Create.

In a minute your environment will be successfully created.

4. With Jelastic you have the ability to set your own domain name for your URL instead of using your hoster domain name. So, buy domain names for your environment. It can be done in two ways: by adding CNAME record or by setting A Records. Read more here.

5. Go back to the Jelastic dashboard, click the Settings button (the wrench icon) for your environment and bind your domains. In our case the URLs are: and

6. Upload your war files/file to the Deployment manager and deploy them to different contexts.

7. Click on config button for Tomcat, navigate to server.xml file (server directory) and set the configuration for host multiple domains (add Host tags for each domain you want to bind).

<Host name="external.domain.tld" appBase="webapps/context_name" autoDeploy="true">
<Context path="" docBase="${catalina.base}/webapps/context_name"/>

8. Save the changes and restart Tomcat.

9. Now you can check the results. You application/s will be available through the specified domain names.

Related articles