Multiple Domains with Public IP

The Benefits of Having Multiple Domains

Usability

One of the main benefits of having multiple domain names is that it gives you multiple points of entry: this can be useful if, for example, you want different domains leading to differently themed sites for different marketing campaigns or user experiences.

Cost Saving

Another benefit that you can take advantage of is the ability to have more than one domain running on a single Cloudjiffy environment. For example, you can have two different applications with two different domains running on a single Tomcat instance.

Setting Up Multiple Domains

(Note:-  In order to use a domain name for your application, you 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:


3.In the Environment Topology dialog, pick your application server (for example, Tomcat 7), switch on Public IPv4 for your server and type your environment name, for example, multi-binding.


In a minute your environment with Tomcat 6 will be successfully created.


Bind your domain names to the Tomcat's Public IP address, which you can find in the drop-down list for the server. The binding procedure depends on the hosting company, where you bought domains.


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


Click on Config button for Tomcat.


Navigate to the server.xml file (server directory) and set the configuration for host multiple domains (add Host tags for each domain you want to host).

For example: 

  1. <Host name="firstdomain.com" appBase="webapps/firstdomain">
  2. <Alias>firstdomain.com</Alias>
  3. <Context path="" docBase="."/>
  4. </Host>
  5.  
  6. <Host name="seconddomain.com" appBase="webapps/seconddomain">
  7. <Alias>seconddomain.com</Alias>
  8. <Context path="" docBase="."/>
  9. </Host>
  10.  
  11. <Host name="thirddomain.com" appBase="webapps/thirddomain">
  12. <Alias>thirddomain.com</Alias>
  13. <Context path="" docBase="."/>
  14. </Host>
  15. ...

 



Save the changes and restart Tomcat.

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













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 afterward.
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to Bind Custom Domain via CNAME

In order to bind custom domain name to such environment, a special CNAME (canonical name)...

How to Bind Custom Domain via A Record

  The majority of applications in production use an External IP address as more secure and...

Powered by WHMCompleteSolution