How subdomains work with JSP hosting in Plesk in the UK

When you add a subdomain in Plesk for a JSP hosting account, Plesk creates a separate website path, document root, and hosting configuration for that name. In practice, that means a subdomain such as app.example.co.uk can be routed to its own JSP application, its own Tomcat context, or a different folder from the main domain. This is useful when you want to keep a Java web app, test environment, or customer portal separate while still managing everything from the same control panel.

For JSP hosting, the important point is that a subdomain is not just a DNS label. It is a hosting object that can be linked to your Apache, Tomcat, or private JVM setup. In a Plesk environment, that makes it easier to deploy WAR files, map application paths, and maintain clear separation between the main site and Java-based services.

How a subdomain is handled in Plesk

In Plesk, a subdomain is a child site under your main domain. It usually gets its own hosting settings, such as:

  • its own document root
  • its own DNS record, if DNS is managed in Plesk
  • separate PHP, Apache, and SSL settings
  • its own web root for static files and application assets
  • optional integration with a Java application server or Tomcat instance

For JSP hosting, the subdomain often points to a web application directory or a Tomcat deployment location. This lets you place JSP pages, servlets, and related resources in a dedicated structure instead of mixing them with the main domain content.

Typical use cases include:

  • hosting a Java app on app.example.co.uk
  • creating a staging environment on staging.example.co.uk
  • separating an admin panel from the public website
  • running a specific Tomcat application under a branded subdomain

Why subdomains are useful for JSP hosting

Subdomains are especially practical for Java hosting because they help separate deployment, routing, and maintenance. JSP applications often have their own build output, context path, and runtime requirements. A subdomain gives you a cleaner structure and reduces the risk of accidental changes to your main site.

Better separation of applications

You can keep the public website on the main domain and place the Java app on a subdomain. This makes it easier to manage different releases, logs, permissions, and file locations.

Easier testing and staging

Many hosting users create subdomains for testing before moving an application to production. A staging subdomain is a good fit for JSP sites because you can test servlets, forms, and integration points without changing the live website.

Cleaner Tomcat deployments

When you use a private JVM or Tomcat instance through My App Server, the subdomain can point to a specific web application context. That makes it simpler to deploy a WAR file or a JSP-based app without affecting other hosted sites in the account.

Improved maintenance

A dedicated subdomain makes tasks such as SSL installation, file updates, access control, and log review more straightforward. If something breaks, you know where to look.

How subdomains work with My App Server in Plesk

ITA’s Java hosting setup uses a Plesk extension called My App Server, which gives you control over a private JVM and Apache Tomcat inside your shared hosting account. In this model, a subdomain can be connected to the application server so it serves JSP content through Tomcat rather than as plain static files only.

The exact behavior depends on how the application is configured, but the general idea is simple:

  • Plesk creates the subdomain and its web root
  • My App Server provides the Java runtime and Tomcat service
  • the subdomain is mapped to a Tomcat application or context
  • JSP and servlet requests are processed by the Java app server

This approach is suitable for small and medium Java applications where you want the convenience of Plesk control, a separate JVM, and easy deployment of WAR or JSP content.

Example setup

Suppose your main domain is example.co.uk and you want a Java app on shop.example.co.uk.

  • Main website: marketing pages, CMS, or static content
  • Subdomain: JSP storefront, checkout flow, or customer account area
  • Tomcat: serves the application on the subdomain
  • SSL: enabled for the subdomain to protect login and form traffic

This keeps the app isolated while remaining under one hosting account and one control panel.

How to create a subdomain in Plesk for JSP hosting

Creating the subdomain is usually the first step before linking it to a Java application. The exact screen labels may vary slightly depending on the hosting setup and permissions, but the workflow is generally similar.

Step 1: Open the domain management area

Log in to Plesk and open the domain where you want to create the subdomain. Go to the section for subdomains or domain management.

Step 2: Add the subdomain name

Enter the subdomain label, such as app, test, or portal. Plesk will combine it with the main domain automatically.

Step 3: Choose the document root

Set a clear document root, ideally one that matches the application purpose. For JSP hosting, it is common to use a folder structure that separates source files, build artifacts, and deployment content.

Examples of useful directory naming:

  • /httpdocs/app
  • /httpdocs/staging
  • /httpdocs/portal

Step 4: Enable SSL if needed

For login areas, forms, or any application that exchanges personal data, enable SSL for the subdomain. This is standard practice for hosted Java web apps and avoids browser warnings.

Step 5: Connect it to the Java application

If you use My App Server, assign the subdomain to the relevant Tomcat application or deployment location. Depending on the hosting configuration, this may be done through the extension interface, application settings, or a custom mapping.

How subdomains map to JSP and Tomcat paths

Subdomains and Tomcat context paths are related, but they are not the same thing. A subdomain is the hostname users type in the browser. A Tomcat context is the application path inside the server.

For example:

  • app.example.co.uk is the subdomain
  • / or /shop may be the Tomcat context path

There are a few common ways to structure this:

  • Subdomain to root context - the app is served directly from the subdomain, with no extra path
  • Subdomain to named context - the app lives under a specific Tomcat context such as /app
  • Subdomain to deployment folder - Plesk points the subdomain to a directory where the app files are stored

For many JSP hosting setups, the cleanest option is to serve the application directly from the subdomain root. That keeps URLs simple and easier to maintain.

Practical URL examples

  • https://app.example.co.uk/ for the main Java app
  • https://staging.example.co.uk/ for testing
  • https://portal.example.co.uk/login for account access

Working with Apache and Tomcat behind a subdomain

In many JSP hosting environments, Apache handles the incoming request first and passes Java-related requests to Tomcat or a private JVM. This can happen through internal routing, proxying, or application server integration depending on the hosting design.

When a subdomain is connected to JSP hosting, Apache may serve static content directly while forwarding JSP requests to the Java runtime. That gives you the benefit of standard web hosting control together with application server behavior.

What this means for you

  • JSP pages are processed by Tomcat, not by Apache alone
  • static assets such as images, CSS, and JavaScript may still be served efficiently from the web root
  • configuration changes in Plesk can affect both web routing and Java application delivery
  • logs may be split between web server logs and application server logs

If you are troubleshooting a subdomain, always check both layers: the Plesk domain settings and the Java application server status.

Best practices for subdomains in JSP hosting

To keep a Plesk-based JSP deployment stable and easy to manage, use a consistent structure from the start.

Use a clear naming convention

Choose subdomain names that reflect purpose, not just technology. For example:

  • app. for the live application
  • test. for internal testing
  • admin. for administration tools
  • api. for service endpoints

Keep application files separated

Do not place JSP application files in the same folder as unrelated site content. A clean folder structure makes deployments safer and rollback easier.

Use SSL from the start

Subdomains used for Java apps often handle authentication, forms, or user sessions. Enable HTTPS early to avoid migration work later.

Check permissions carefully

Java applications may need read and write access to certain directories, such as upload folders, cache locations, or log output folders. Make sure the account permissions match what the application needs, but do not grant broader access than necessary.

Monitor logs after deployment

After linking the subdomain to Tomcat, review the web server and application logs. This helps you catch startup problems, missing classes, wrong context paths, or permission issues quickly.

Keep the deployment model simple

For shared hosting JSP setups, a simple structure is usually best. Use one subdomain per app or per environment, and avoid overcomplicating the layout unless you have a clear reason.

Common issues with subdomains and JSP hosting

Even a correctly created subdomain can still fail to serve a JSP app if the Java layer is not set up properly. Here are common problems and what they usually mean.

The subdomain opens, but shows a default page

This often means the subdomain points to the wrong document root, or the Tomcat mapping is not connected to the application folder. Check whether the application has been deployed to the correct context.

JSP pages download instead of running

This usually indicates that the request is being handled as a static file rather than by Tomcat. In that case, review the application server configuration and make sure the subdomain is linked to the Java runtime.

403 or permission denied errors

The hosting user or service account may not have the right file access. Confirm that the app files are readable by the web server and that any writable directories are correctly assigned.

502 or gateway errors

This can happen when the Tomcat service is stopped, the JVM is not running correctly, or the app server configuration has an invalid path. Check service status in My App Server and review the logs.

SSL warning on the subdomain

If HTTPS is enabled but the certificate does not include the subdomain, browsers will warn about a name mismatch. Install or renew a certificate that covers the subdomain properly.

Using subdomains for staging and releases

One of the most practical uses of subdomains in JSP hosting is release management. You can keep a development or staging version of your application on a separate subdomain, then promote the same build structure to production once it is ready.

A simple workflow might look like this:

  • dev.example.co.uk for internal testing
  • staging.example.co.uk for final checks
  • app.example.co.uk for the live application

This setup helps you test JSP pages, servlets, form handling, and session behavior before going live. It is especially useful when your app relies on a private JVM and Tomcat configuration that you want to validate safely.

FAQ

Can a subdomain run a separate JSP application in Plesk?

Yes. In a JSP hosting setup, a subdomain can be linked to its own document root and, when configured, to its own Tomcat or Java application context.

Do I need Tomcat for JSP hosting on a subdomain?

Yes, JSP content requires a Java application server such as Tomcat to process the pages. A subdomain alone is not enough unless it is connected to the Java runtime.

Can I use the same hosting account for the main domain and subdomain apps?

Yes. That is one of the main advantages of Plesk-based hosting with My App Server. You can manage the main site and Java subdomains from one account while keeping them separated.

Should I point a subdomain to the same folder as the main site?

Usually no. For JSP hosting, it is better to keep the subdomain in a separate folder so the application files stay organized and isolated from the main website.

Can I use a subdomain for a staging Tomcat app?

Yes. This is a common and recommended approach. A staging subdomain lets you test updates before publishing them to the live site.

What is the difference between a subdomain and a Tomcat context?

A subdomain is the hostname, such as app.example.co.uk. A Tomcat context is the internal application path, such as / or /shop. They work together, but they are configured separately.

Can I use SSL on a JSP subdomain?

Yes, and it is recommended. Most JSP applications handle forms, logins, and user sessions, so HTTPS should be enabled on the subdomain.

Does My App Server support a private JVM for a subdomain?

My App Server is designed to provide Java hosting with a private JVM and Tomcat inside the shared hosting account. That makes it suitable for connecting one or more subdomains to separate Java applications, depending on your plan and configuration.

Summary

Subdomains in Plesk are a practical way to organize JSP hosting. They let you separate applications, create staging environments, and connect specific hostnames to Tomcat-based deployments. With My App Server, you can manage Java hosting through Plesk, use a private JVM, and serve JSP and servlet applications from clean, dedicated subdomain structures.

If you keep the folder layout simple, map the subdomain correctly, and verify SSL and service status after deployment, subdomain-based JSP hosting is straightforward to maintain and well suited to small and medium Java applications.

  • 0 Users Found This Useful
Was this answer helpful?