How subdomains work with Java hosting in Plesk in the UK

When you use Java hosting in Plesk, a subdomain usually acts as a separate website entry that can point to its own document root, its own application files, and its own Java or Tomcat setup through My App Server. This makes subdomains a practical way to separate environments such as app.example.co.uk, test.example.co.uk, or api.example.co.uk without needing a separate hosting account.

In a managed hosting setup, this is especially useful because you can keep your main site, Java application, and supporting services organised inside one Plesk account. If your hosting platform includes a Java extension such as My App Server, the subdomain can be configured to run a private JVM or Apache Tomcat instance, depending on the version and setup you choose.

How a subdomain is handled in Plesk

A subdomain is a DNS and hosting record that sits under your main domain. In Plesk, it is typically created as a separate webspace entry with its own settings. That means you can assign different content, different file paths, and different hosting behaviour from the main domain.

For example, if your main domain is example.co.uk, you can create:

  • www.example.co.uk for the main website
  • app.example.co.uk for a Java application
  • shop.example.co.uk for another service or storefront

In Plesk, each subdomain can be managed from the same control panel. Depending on the hosting configuration, the subdomain may use:

  • a separate document root
  • its own SSL certificate
  • distinct PHP, Apache, or Java settings
  • its own logs and resource limits where supported

For Java hosting, the key point is that the subdomain can be mapped to a specific application path or service endpoint, so your Java app does not need to share the same file structure as the main website.

What changes when Java hosting is enabled

When Java hosting is available through My App Server, a subdomain can become the public entry point for your Java application. Instead of serving static files only, the subdomain can be connected to a private Apache Tomcat instance or another supported Java runtime managed from Plesk.

This is useful for:

  • WAR deployments
  • JSP applications
  • Servlet-based projects
  • small and medium Java web apps
  • separate test and live environments

In this model, the subdomain is not just a DNS name. It is part of the hosting configuration that helps route requests to the correct Java service. Depending on how the extension is set up, you may be able to:

  • install a ready-made Tomcat version with one click
  • upload or configure a custom app server version manually
  • start, stop, or restart the service from Plesk
  • choose the Java version required by your app

That gives you a cleaner setup than placing multiple applications into one shared directory structure.

Typical subdomain setup for Java applications

A common structure for a Java hosting account in Plesk is:

  • Main domain: company website, landing pages, or CMS
  • Subdomain: Java application running on Tomcat
  • Another subdomain: staging or test copy of the application

For example:

  • example.co.uk — public website
  • app.example.co.uk — live Java app
  • dev.example.co.uk — test environment

This approach is practical because the main domain and the subdomain can each follow their own deployment path. You can update the Java app on the subdomain without affecting the main site, and you can keep test changes isolated until they are ready.

How subdomains work with My App Server

ITA’s Java hosting in Plesk uses the My App Server extension to manage Java services inside a hosting account. In this model, the subdomain is often linked to an app server instance that runs separately from the main web content.

That means:

  • you can create a subdomain and bind it to the Java service
  • the app can run under a private JVM within the hosting account
  • you can deploy a Tomcat-based application without managing a full server manually
  • you can control service status from the panel

If your application uses a WAR file, the subdomain can be the address users type in their browser while Tomcat handles the application processing behind the scenes. If your app uses JSP or servlets, the same principle applies: the subdomain becomes the visible host name, while the Java runtime handles the request.

This setup is especially helpful when you need a clean separation between websites, APIs, and internal tools, but you still want one control panel to manage them.

Creating a subdomain for Java hosting in Plesk

The exact steps may vary depending on your hosting plan and the My App Server configuration, but the general process is usually similar.

1. Create the subdomain

Open Plesk and go to the domain management section. Add a new subdomain under your main domain, for example app.example.co.uk.

During creation, Plesk will usually assign:

  • the subdomain name
  • a document root folder
  • basic hosting settings

Choose a meaningful document root, especially if you plan to deploy a Java application there. Many hosting teams prefer a dedicated folder structure so that Java app files stay separate from static content or other site assets.

2. Assign the correct hosting mode

Make sure the subdomain is configured for the type of application you want to run. In a Java hosting environment, this often means enabling the My App Server application path or binding the subdomain to the Java service managed in Plesk.

If your plan supports both static web hosting and Java hosting, check that the subdomain is not pointing only to a plain HTML directory if the application requires Tomcat.

3. Select or install the Java/Tomcat version

Through My App Server, you may see several ready-to-use Java or Tomcat versions. Choose the one required by your application. If your app needs a specific version not offered in the default list, you may be able to upload and configure a custom version manually.

Before changing the version, confirm:

  • your application’s Java compatibility
  • Tomcat requirements
  • library dependencies
  • any environment variables or startup options the app needs

4. Deploy the application files

Upload your WAR, JSP files, or application content to the correct directory for the subdomain or app server instance. The deployment method depends on how My App Server is set up, but the goal is always the same: make sure the subdomain points to the right application root.

If your app includes a packaged WAR, you may deploy it directly. If it is an unpacked application, verify that the folder structure matches the app server expectations.

5. Check service control and restart if needed

After deployment, use the service controls in Plesk to start or restart the Java application server. This is important when you change application files, update configuration, or switch Java versions.

Service control usually helps you:

  • start Tomcat after installation
  • restart the JVM after code changes
  • stop the service during maintenance
  • check whether the app is running correctly

6. Test the subdomain in the browser

Visit the subdomain and confirm that the Java application responds as expected. If the page does not load correctly, check the mapping between the subdomain, the document root, and the app server instance.

DNS and propagation considerations

Subdomains depend on DNS records. In many cases, the Plesk panel can create or suggest the correct record automatically, but the record still needs to resolve properly for the subdomain to be reachable.

If the subdomain is new, it may take some time before the DNS changes are visible everywhere. During that period, your application may work in one location but not yet in another due to propagation.

Useful checks include:

  • confirming the DNS record exists for the subdomain
  • making sure the record points to the correct hosting target
  • waiting for propagation if the subdomain was just created
  • verifying that SSL is installed if you use HTTPS

For Java apps, DNS issues are often mistaken for application errors. If the service is running but the subdomain does not resolve, the issue is usually at the DNS or domain mapping level rather than in Tomcat.

SSL and HTTPS on a Java subdomain

Most production subdomains should use HTTPS. In Plesk, you can usually manage SSL certificates separately for each subdomain. This is important if your Java app handles logins, forms, APIs, or session data.

When you enable SSL for a Java subdomain:

  • the browser connects securely over HTTPS
  • session and credential data are protected in transit
  • the application presents a more trustworthy public endpoint

After installing or renewing the certificate, check that the subdomain is forced to the secure version if that is part of your setup. If your Java app generates links or redirects, make sure it is aware that it runs behind HTTPS.

Common use cases for subdomains in Java hosting

Subdomains are especially useful when you want to organise Java hosting more cleanly. Common setups include:

  • app. for the live Java application
  • test. for staging or QA
  • api. for an API endpoint
  • admin. for internal administration tools
  • docs. for documentation or support pages connected to the application

This structure helps separate traffic and makes maintenance easier. It also reduces the risk of mixing application files with the main site or other services.

Best practices for subdomains with Tomcat or a private JVM

To keep your Java hosting manageable, follow a few practical guidelines:

  • Use a separate subdomain for each major application or environment.
  • Keep file paths clear and avoid reusing the same folder for different services.
  • Match the Java and Tomcat version to the application requirements.
  • Use service controls to restart the app after deployment changes.
  • Test updates on a staging subdomain before applying them to the live one.
  • Keep SSL enabled on public-facing subdomains.
  • Review logs when the app does not start or the subdomain shows an error.

If your hosting account includes limits for process usage, memory, or service counts, keep these in mind when planning multiple subdomains. A single shared hosting account can support practical Java setups well, but it is still important to stay within the available limits.

Troubleshooting subdomains in Java hosting

If a subdomain does not work as expected, the issue is often one of a few common causes.

The subdomain opens but shows the wrong content

This usually means the document root or application binding is incorrect. Check whether the subdomain points to the correct Java app directory or Tomcat instance.

The subdomain does not load at all

Possible causes include:

  • missing or incorrect DNS record
  • DNS propagation delay
  • SSL misconfiguration
  • service not running

The Java app returns an error after deployment

Check the Tomcat or app server logs, confirm the Java version, and verify that the deployment package is valid. If you recently switched the application server version, make sure the app is compatible with it.

The app starts, but redirects fail

Some Java applications need to know whether they are accessed via a subdomain and whether HTTPS is enabled. Review application settings for base URL, context path, and proxy or SSL awareness.

FAQ

Can I run a Java application on a subdomain in Plesk?

Yes. In a Java hosting setup, a subdomain can be linked to a Tomcat instance or private JVM managed through Plesk, depending on your hosting configuration.

Do I need a separate hosting account for each subdomain?

Not usually. Many hosting plans allow multiple subdomains within the same account, with separate folders and application settings.

Can I use different Java versions for different subdomains?

Depending on the hosting platform and My App Server setup, yes. This is useful when one app needs an older Java version and another uses a newer one.

Is a subdomain suitable for staging or testing?

Yes. Subdomains are commonly used for staging, QA, and development because they keep test environments separate from the live site.

Can I host JSP or servlet apps on a subdomain?

Yes. JSP and servlet applications are a standard use case for Tomcat-based Java hosting on a subdomain.

What should I check first if the subdomain is not working?

Start with DNS, then confirm the Plesk hosting mapping, the app server status, and the SSL configuration. If the service is running but the app fails, review the Java and Tomcat logs.

Summary

Subdomains in Plesk are a practical way to organise Java hosting, especially when you want a separate address for a Tomcat app, JSP project, servlet application, or private JVM service. With My App Server, a subdomain can become the public endpoint for your Java app while staying manageable from the same control panel.

For most hosting users, the main benefits are clear: cleaner structure, easier deployment, separate environments, and straightforward service control. If you configure the subdomain carefully, it can provide a simple and reliable setup for Java applications without the complexity of a larger enterprise platform.

  • 0 Users Found This Useful
Was this answer helpful?