The Benefits of Having Multiple Domains
Usability
One of the main benefits of having multiple domain names is that it gives me multiple points of entry: this can be useful if, for example, I want different domains leading to differently themed sites for different marketing campaigns or user experiences.
Cost Saving
Another benefit that I can take advantage of is the ability to have more than one domain running on a single Cloudjiffy environment. For example, I can have two different applications with two different domains running on a single Tomcat instance.
(Note:- In order to use a domain name for my application, I need to register it or have administrative access to it. )
1.Log into the Cloudjiffy Manager.
2. While in Cloudjiffy dashboard, click the Create environment button:
![](https://cloudjiffy.com/portal/images/links/multiple%20domain%20with%20multiple%20ip/multiple%20domain-ip1.png)
3.In the Environment Topology dialog, pick my application server (for example, Tomcat 7), switch on Public IPv4 for my server and type my environment name, for example, multi-binding.
![](https://cloudjiffy.com/portal/images/links/multiple%20domain%20with%20multiple%20ip/multiple%20domain-ip2.png)
In a minute my environment with Tomcat 6 will be successfully created.
![](https://cloudjiffy.com/portal/images/links/multiple%20domain%20with%20multiple%20ip/multiple%20domain-ip3.png)
Bind my domain names to the Tomcat's Public IP address, which I can find in the drop-down list for the server. The binding procedure depends on the hosting company, where I bought domains.
![](https://cloudjiffy.com/portal/images/links/multiple%20domain%20with%20multiple%20ip/multiple%20domain-ip4.png)
Upload my war files/file to the Deployment manager and deploy them to different contexts.
![](https://cloudjiffy.com/portal/images/links/multiple%20domain%20with%20multiple%20ip/multiple%20domain-ip5.png)
Click on Config button for Tomcat.
![](https://cloudjiffy.com/portal/images/links/multiple%20domain%20with%20multiple%20ip/multiple%20domain-ip6.png)
Navigate to the server.xml file (server directory) and set the configuration for host multiple domains (add Host tags for each domain I want to host).
For example:
<
Host
name
=
"firstdomain.com"
appBase
=
"webapps/firstdomain"
>
<
Alias
>firstdomain.com
Alias
>
<
Context
path
=
""
docBase
=
"."
/>
Host
>
<
Host
name
=
"seconddomain.com"
appBase
=
"webapps/seconddomain"
>
<
Alias
>seconddomain.com
Alias
>
<
Context
path
=
""
docBase
=
"."
/>
Host
>
<
Host
name
=
"thirddomain.com"
appBase
=
"webapps/thirddomain"
>
<
Alias
>thirddomain.com
Alias
>
<
Context
path
=
""
docBase
=
"."
/>
Host
>
...
![](https://cloudjiffy.com/portal/images/links/multiple%20domain%20with%20multiple%20ip/multiple%20domain-ip7.png)
Save the changes and restart Tomcat.
Now I can check the results. My application/s will be available through the specified domain names.
![](https://cloudjiffy.com/portal/images/links/multiple%20domain%20with%20multiple%20ip/multiple%20domain-ip8.png)
![](https://cloudjiffy.com/portal/images/links/multiple%20domain%20with%20multiple%20ip/multiple%20domain-ip9.png)
![](https://cloudjiffy.com/portal/images/links/multiple%20domain%20with%20multiple%20ip/multiple%20domain-ip10.png)
Note: if I want to redeploy an application to the Tomcat instance with already configured server.xml, I need to comment < Host > block before redeploying and uncomment it afterward.