How to Set up Multiple Domains on AccuWeb.Cloud?
Whether you’re an entrepreneur with diverse business ventures or a web developer handling various client projects, efficiently managing multiple domains is crucial for a seamless online presence. AccuWeb.Cloud, a robust and user-friendly cloud hosting platform, provides a straightforward process for setting up and managing multiple domains within a single environment.
This guide will walk you through the step-by-step process of configuring and hosting multiple domains on AccuWeb.Cloud. By leveraging the platform’s intuitive interface and powerful features, you can streamline the management of your web properties, ensuring optimal performance, security, and scalability.
Step to Configure Multiple Domains
To utilize a domain name for your application, it is necessary to either register it or have administrative access to it.
Step 1: Sign in to the PaaS account.
Step 2: In the platform dashboard, select the “New Environment” button:
Step 3: Within the Environment Topology dialog, choose your application server (e.g., Tomcat), enable Public IPv4 for your server, and enter your environment name.
Your Tomcat environment will be successfully created in just a minute.
Acquire domain names and configure them in place of the default ones by adding a CNAME record or setting A Records.
Step 4: Bind your domain names with Tomcat’s Public IP address, accessible by expanding the Application servers and clicking on the node. The binding procedure varies depending on the hosting company from which you purchased the domains.
In this illustration, we will utilize stptraining.in as the first domain name and stpwptraining.in as the second domain name.
Step 5: Now, deploy the projects.
Upload the application file to the Deployment Manager & click the Deploy button. For instance, we use Hello World, which is, by default, available in the Deployment Manager.
When the Deploy form appears, select your environment and assign the context (in this case, “first”). Subsequently, click the Deploy button.
Upload the archive for the second application and deploy it to the same environment but with a different context (e.g., Second). Utilize a modified version of the previous file, making slight modifications to observe differences in the final steps.
After the deployment, you will have two applications successfully deployed in your environment.
Click on Tomcat’s “Config” button, then access the server.xml file in the /opt/tomcat/conf directory.
Include <Host> tags for every domain you wish to bind:
<Host name="external.domain.tld" appBase="webapps/context_name" autoDeploy="true"></pre>
<Alias>external.domain.tld</Alias>
<Context path="" docBase="."/>
</Host>
In our example, we incorporate the following code into the server.xml file:
<Host name="stptraining.in/www.stptraining.in" appBase="webapps/First" autoDeploy="true">
<Alias>stptrainig.in</Alias>
<Context path="" docBase="."/>
</Host>
<Host name="www.stptraining.in" appBase="webapps/First" autoDeploy="true">
<Alias>www.stptrainig.in</Alias>
<Context path="" docBase="."/>
</Host>
<Host name="stpwptraining.com" appBase="webapps/Second" autoDeploy="true">
<Alias>stpwptraining.com</Alias>
<Context path="" docBase="."/>
</Host>
<Host name="www.stpwptraining.com" appBase="webapps/Second" autoDeploy="true">
<Alias>www.stpwptraining.com</Alias>
<Context path="" docBase="."/>
</Host>
Save the changes and restart Tomcat.
Verify the results now. Your applications will be accessible through custom domain names on a unified Tomcat server.
Isn’t it simple? You now understand how to configure multiple domain names to enhance your Java application’s usability, efficiency, and scalability, all while saving costs without needing separate web server configurations. Sign up for free on our AccuWeb.Cloud platform and explore it yourself.