Subdomains in Plesk can be used with Java hosting, but the way they are handled depends on how your domain, document root, and My App Server are configured. In a Java hosting setup, a subdomain is usually more than just a DNS label: it is often a separate web space or a separate hosting context that may point to its own Tomcat application, WAR deployment, or JVM process.
If you are using a managed hosting platform with Plesk and the My App Server extension, the main goal is to make sure the subdomain resolves correctly, has the right hosting settings, and is mapped to the Java application you want to publish. In practice, that means checking the subdomain’s DNS, document root, service settings, and Tomcat deployment path before you upload or deploy your app.
How subdomains behave in Plesk Java hosting
A subdomain such as app.example.com is treated in Plesk as a separate hosting object under the parent domain. It can have its own document root, SSL certificate, PHP settings, mail settings, and, in many cases, its own application deployment target. For Java hosting, the important part is that the subdomain must be connected to the correct Java service or Tomcat instance.
With My App Server, a subdomain can be used to:
- publish a separate Java web application;
- run a WAR-based application on its own context;
- point to a specific Tomcat installation or service;
- serve a JSP or servlet application under a dedicated hostname;
- keep different environments separated, for example test.example.com and app.example.com.
The subdomain itself does not “become Java” automatically. It still needs to be linked to the correct service and application path. If the hosting settings point the subdomain to a static folder or a different web server configuration, your Java app may not load as expected.
Typical ways to use subdomains with Java hosting
There are a few common setups in Plesk when working with Java applications and subdomains.
One subdomain, one Java application
This is the simplest and most common approach. You create a subdomain and deploy one Java application to it. For example:
- app.example.com for the main application;
- admin.example.com for the admin panel;
- test.example.com for testing or staging.
Each subdomain can have a separate document root and a separate deployment path in My App Server. This keeps application files organized and reduces the risk of accidental overwrites.
Subdomain as a context path for Tomcat
In some cases, the subdomain points to a Tomcat application that is deployed under a specific context path. For example, the app may be available at:
https://app.example.com/myapp
This can happen when the WAR file is deployed with a context name or when the application server is configured with a specific application root. If you want the subdomain to open the app directly at the root URL, make sure the deployment and reverse mapping are set correctly.
Multiple subdomains for separate services
You may also use separate subdomains for different Java services. For example:
- api.example.com for a servlet-based API;
- portal.example.com for the user portal;
- jobs.example.com for scheduled or internal tasks if they are exposed through a web interface.
This is useful when you want each application area to have its own hostname, SSL certificate, logs, and service controls.
What you need to check before deploying a Java app to a subdomain
Before you deploy a Java application on a subdomain in Plesk, confirm the following settings.
1. DNS record for the subdomain
The subdomain must resolve to the correct server. Usually this means an A or CNAME record must exist for the hostname. If DNS is not correct, the browser will not reach your hosting service, even if Tomcat is running properly.
Check that:
- the subdomain exists in DNS;
- the record points to the correct IP or target;
- DNS changes have propagated;
- there are no conflicting records for the same hostname.
2. Hosting settings in Plesk
Open the subdomain settings in Plesk and verify the hosting configuration. In a Java hosting environment, the subdomain should be linked to the correct application root or custom server configuration. If the subdomain is still configured for a regular web folder, the request may not be forwarded to Tomcat.
Look for settings related to:
- document root;
- hosting type;
- SSL/TLS status;
- custom web server handling;
- Java application mapping.
3. My App Server deployment target
If you use ITA’s My App Server extension, confirm that the subdomain is connected to the correct Java service. Depending on your setup, the application can use a built-in Tomcat version, a custom Tomcat package, or a private JVM instance within your hosting account.
Make sure the deployment target matches the intended subdomain. For example, do not deploy the production WAR to the staging subdomain by mistake.
4. Java and Tomcat version compatibility
Different Java applications require different runtime versions. A subdomain may work perfectly from the DNS side but still fail if the app needs a Java version that is not compatible with the selected runtime.
Check:
- the Java version required by the application;
- the Tomcat version selected in My App Server;
- any library or servlet API dependency in the app;
- whether the app is designed for WAR deployment.
5. SSL certificate for the subdomain
Most Java apps today are published over HTTPS. If your subdomain uses SSL, make sure the certificate includes that hostname. Otherwise, browsers may show certificate warnings or block secure requests.
After creating a subdomain, install or renew the SSL certificate and verify that HTTPS works before deploying the application.
How to set up a subdomain for Java hosting in Plesk
The exact buttons may vary depending on the hosting plan and the control panel configuration, but the general process is the same.
Step 1: Create the subdomain
In Plesk, add the subdomain under the main domain. Use a clear name that matches its purpose, such as app, api, or staging. This helps when managing multiple Java applications.
Step 2: Confirm the hosting type
After creating the subdomain, review the hosting settings. Ensure it is set up in a way that allows Java application handling through My App Server or the related hosting integration. If the subdomain is only serving files from a plain directory, it will not automatically run your Java application.
Step 3: Install or select the Java/Tomcat version
Using My App Server, select the Java or Tomcat version that your app needs. Some hosting platforms provide ready-to-use versions through an install button, while others allow manual upload and configuration of a custom version.
Choose the version that matches your app requirements and the deployment method you plan to use.
Step 4: Deploy the application
Upload the WAR file or application package to the correct deployment target. If your app is already packaged for Tomcat, deploy it through the service interface provided by My App Server or the related Plesk extension.
After deployment, verify that the app starts without errors and that the subdomain opens the correct landing page.
Step 5: Test the subdomain in the browser
Open the subdomain over both HTTP and HTTPS if possible. Check:
- whether the app loads;
- whether static assets are served correctly;
- whether login and form actions work;
- whether API endpoints return the expected response;
- whether redirects point to the correct hostname.
Common issues when subdomains are used with Java hosting
The subdomain opens a default page instead of the Java app
This usually means the hostname is pointing to the wrong document root or the Java application is not mapped to that subdomain. Check the hosting settings and verify the deployment target in My App Server.
DNS works but the app does not start
If the browser reaches the server but the Java app does not load, the issue is likely in Tomcat, the Java runtime, or the deployment package. Review service status, logs, and app compatibility.
The subdomain shows a 404 error
A 404 can mean the application context path is wrong, the WAR was not deployed correctly, or the reverse mapping from the subdomain to the app is incomplete. Confirm the expected URL path and check the deployed files.
HTTPS does not work on the subdomain
This often happens when the certificate does not include the subdomain, or when the SSL configuration was not applied after the hostname was created. Reissue or attach the correct certificate, then retest the connection.
Changes do not appear immediately
If you changed DNS or hosting settings, wait for propagation and clear browser or resolver cache if needed. Also check whether the application was redeployed after changing the subdomain mapping.
Best practices for managing Java applications on subdomains
Using subdomains in a Java hosting environment is easier when you keep a few simple rules in mind.
- Use one subdomain per application or environment when possible.
- Keep production, testing, and internal tools separated.
- Match the Tomcat/Java version to the application requirements.
- Document which subdomain uses which WAR file or service.
- Review logs after deployment to catch startup issues early.
- Keep SSL certificates aligned with all active hostnames.
- Use clear names so the subdomain purpose is obvious to your team.
For managed hosting users, this approach makes support easier too, because each subdomain has a clear purpose and a more predictable configuration.
How My App Server helps with subdomains
ITA’s My App Server extension is designed to simplify Java hosting inside Plesk. Instead of treating the subdomain as a generic folder, the extension allows you to work with a more application-focused setup. That is useful when you need:
- a private JVM within a shared hosting account;
- a specific Apache Tomcat version for one app;
- simple service control from Plesk;
- support for WAR, JSP, and servlet deployment;
- separate runtime settings for different applications.
For subdomains, this means you can publish Java applications in a structured way without manually managing every lower-level detail. You still need to use the correct hostname, document root, and service mapping, but the control panel gives you a practical interface for day-to-day administration.
When to use a subdomain instead of a subdirectory
In Java hosting, a subdomain is often the better choice when the application should behave like a separate site or service. Use a subdomain when:
- the app has its own login or user area;
- you want separate SSL handling;
- you need clean separation between services;
- the application may later move to a different runtime;
- you are testing a new version before release.
A subdirectory such as example.com/app can work in some cases, but it is usually less flexible for Java deployments because routing, cookies, redirects, and app context can become harder to manage. For Tomcat-based hosting, a subdomain is often simpler and cleaner.
FAQ
Can I run more than one Java app on different subdomains?
Yes. This is a common setup in Plesk. You can use separate subdomains for separate applications, as long as each one is mapped to the correct Java service or deployment path.
Does creating a subdomain automatically enable Java hosting?
No. The subdomain must still be configured to use the correct Java/Tomcat service. Creating the hostname only adds the domain entry; it does not deploy the application by itself.
Can I use a subdomain with a custom Tomcat version?
Yes, if your hosting plan and My App Server setup support custom application servers. The subdomain can be linked to a custom Tomcat installation or a ready-made version, depending on your configuration.
Why is my subdomain not showing the deployed WAR file?
Most often this is caused by a wrong hosting mapping, an incorrect context path, or deployment to the wrong service. Check the subdomain settings, deployment target, and application logs.
Do subdomains need separate SSL certificates?
They need to be covered by the certificate. That can mean a certificate that includes the subdomain specifically, or a wildcard certificate if your hosting setup uses one.
Can I use the same Java app on multiple subdomains?
Technically yes, but it depends on how the app is designed and how routing is configured. In most cases, it is better to deploy separate instances or use one primary hostname to avoid confusion with cookies, callbacks, and redirects.
What should I check first if the subdomain gives an error after deployment?
Start with DNS, then verify the hosting settings, then confirm the Java/Tomcat service status, and finally review the application logs. This sequence usually identifies the problem quickly.
Conclusion
Subdomains in Plesk work well with Java hosting when they are set up as part of a clear application structure. The key points are simple: the hostname must resolve correctly, the hosting settings must point to the right Java service, and the application must be deployed to the correct Tomcat or JVM environment.
For My App Server users, subdomains are a practical way to separate Java applications, test environments, and service areas while keeping everything manageable from Plesk. If you verify DNS, SSL, deployment path, and runtime version before launch, you will avoid most common issues and keep your Java hosting setup stable and easy to maintain.