Operating multiple custom domains on the GlassFish Server
Let’s look at how to set up multiple domain names for a Java application hosted on GlassFish, a server known for its enterprise-grade features and cost-effectiveness as an open-source solution. Let’s dive into setting up multiple domain names for a Java application on GlassFish.
To set up multiple domains for your Java application on a GlassFish server, just follow these straightforward steps.
1. Log in to the platform dashboard and find the “Create environment” button.
2. Choose GlassFish as your application server and set the cloudlet limits as needed. Enter a name for your environment and click “Create“.
3. Within seconds, your environment will be successfully created and will appear on the dashboard in the list of environments.
4. Next, you’ll need to add a CNAME record or set an A Record for your custom domains, following the instructions in the Custom Domains document.
5. To bind your custom domain names, follow these steps:
- Click the “Settings” button next to your environment.
- Choose the “Custom domains” setting.
- Enter your domain names (e.g., myapplication.com and myapplication.org) in the appropriate field.
- Click the “Bind” button to complete the process.
6. After creating the environment, you should have received a link and credentials for the GlassFish DAS (Domain Administration Server) node. Use these credentials to log in to the admin panel. Once logged in, navigate to the “Applications” tab to deploy your Java application.
7. After deploying your application, go to the “Configurations” > “default-config” > “Virtual Servers” section and click the “New” button to create a new virtual server.
8. Enter the ID for the new server, specify the custom domains associated with your environment in the “Hosts” field (separated by commas), and then select the appropriate HTTP listener and web module.
9. Save the changes, and you are all set! Now your application will be accessible via all the specified domain names.
Managing application custom domains with the platform’s tools is straightforward and user-friendly. Enjoy the process!