We have previously shared all of the benefits of having multiple custom domains for your Java and PHP web sites in these posts:
- Running Multiple Domain Names on Apache Server
- Multiple Domains in Jelastic: Part II
- Multiple Domains in Jelastic
Today, we will show you how to run a few domain names on Java application server GlassFish, which combines enterprise-class capabilities with open source cost efficiency. It's an enterprise-ready application server with true interoperability and a wide range of features including superior documentation, administration, and configuration.
Let's see how to run multiple domains for your Java site on GlassFish server in just a few minutes!
1. Log into the Jelastic dashboard and click Create environment.
2. Select application server GlassFish and specify the cloudlet limits for it. Enter your environment name and click Create.
3. In a matter of seconds you environment will be successfully created and appear on the dashboard.
4. Next, you will need to add a CNAME record or set an A Record. You can find more information on how to do this in our custom domains document.
5. Bind your custom domains by clicking the Settings button for your environment and choosing the appropriate setting. We'll use myapplication.com and myapplication.org domains as examples.
Note: We've put entries into our hosts file for local testing so this will work only from our machine, which has those hosts' entries.
7. When you created the environment, Jelastic sent you the link and credentials to GlassFish DAS node. Log in using these credentials and navigate to the Applications tab in order to deploy your application.
8. Once your application is successfully deployed go to Configurations > default-config > Virtual Servers and click New... to create new virtual server.
9. Specify the ID of the new server, enter bounded to your environment custom domains separated by commas in the Hosts field, select the suitable http listener and then choose the required web module.
It's very easy to manage your custom domains with Jelastic's rich set of tools. Enjoy! And don't forget to tell your friends about how awesome hosting in the Jelastic cloud is!