When you use JSP hosting in Plesk, subdomains work almost the same way as they do on standard web hosting, but the document root, hosting type, and Java application setup need a little more attention. A subdomain can point to its own folder, use its own PHP or static site configuration, and in a JSP hosting setup it can also be mapped to a separate Java web application or Tomcat context, depending on how your hosting account is configured.
In a managed hosting environment with Plesk, this is useful when you want to separate parts of a project such as app.example.com, blog.example.com, shop.example.com, or a test environment like dev.example.com. For JSP hosting, the main question is not only where the subdomain points, but also how it is connected to the Java service, WAR deployment, and the correct Tomcat or JVM instance.
How subdomains are handled in Plesk for JSP hosting
In Plesk, a subdomain is a separate web space entry under your main domain. It usually has its own:
- document root or hosting directory
- DNS record
- hosting settings
- SSL certificate option
- log files
- application deployment path
For standard hosting, that is often enough. For JSP hosting, the subdomain also needs a working Java runtime environment and a servlet container such as Apache Tomcat. In ITA’s Java hosting setup, this is provided through My App Server, a Plesk extension that lets you manage a private JVM and Tomcat instance inside your shared hosting account.
This means a subdomain can be used as a clean endpoint for a JSP application, while the actual Java process runs inside the configured app server service.
Typical subdomain setup options for JSP and Tomcat
There are several common ways to use subdomains with JSP hosting in Plesk:
1. Subdomain mapped to its own Tomcat application
This is the most common setup for a Java web app. The subdomain, such as app.example.com, points to a separate folder and Tomcat serves the JSP files, servlets, and WAR contents from there.
Use this when you want a dedicated application URL and a clear separation from your main site.
2. Subdomain as a staging or test environment
You can create a subdomain like test.example.com or dev.example.com and deploy a separate version of your app there. This is useful for checking JSP changes, testing servlet behavior, or verifying configuration updates before publishing them on the main domain.
3. Subdomain for a specific application module
Some projects use different subdomains for different app areas. For example, the public website can stay on the main domain while the customer portal runs on a subdomain. In JSP hosting, that subdomain can point to its own web application and use its own deployment package.
4. Subdomain forwarding to an app path
In some cases, the subdomain is configured to serve an application located in a subdirectory or behind a reverse proxy-like routing setup inside the hosting account. This depends on the host’s Plesk configuration and the way My App Server is connected to Apache and Tomcat.
What makes JSP subdomains different from regular web subdomains
A normal static or PHP subdomain usually only needs the right folder and web server settings. JSP hosting adds another layer because Apache must hand requests over to the Java application server.
The main differences are:
- Java runtime required: JSP files need Tomcat or another servlet container.
- Application deployment: You may deploy a WAR file or unpacked web app into the subdomain’s app directory.
- Context mapping: The subdomain must be linked to the right context path or instance.
- Service control: The Java service may need to be started, stopped, or restarted from Plesk.
- Version selection: Different apps may require different Java versions or Tomcat builds.
With ITA’s My App Server, these steps are designed to be practical in Plesk. The goal is to let you run a private JVM and Apache Tomcat instance for your hosting account without needing a separate enterprise application platform.
How subdomains usually point to the correct JSP application
When a subdomain is created in Plesk, it typically receives its own hosting directory. For JSP hosting, that directory is often connected to the Java app server configuration. The app may be deployed as:
- a WAR file
- an exploded web application folder
- a custom Tomcat application directory
- a manually configured context path
For example, if app.example.com should serve a Java application, Plesk and My App Server need to ensure that requests to the subdomain are delivered to the correct Tomcat instance and that the app root matches the deployed files.
If the mapping is incorrect, the subdomain may show a default Plesk page, a 404 error, or a blank response because Apache and Tomcat are not pointing to the same application root.
Steps to create a subdomain for JSP hosting in Plesk
The exact menu names may vary slightly depending on your hosting plan and enabled extensions, but the general workflow is similar.
Step 1: Add the subdomain in Plesk
Go to your domain in Plesk and create the subdomain, for example app.example.com. Choose a clear name that matches the purpose of the application.
Good naming helps later when you manage logs, SSL, deployment, and service mapping.
Step 2: Confirm the document root
Make sure the subdomain has its own document root or web root directory. In many cases, Plesk creates a folder such as:
- /subdomains/app/
- /httpdocs/app/
- /var/www/vhosts/example.com/app.example.com/
The exact path depends on the hosting setup. For JSP hosting, this directory should match where your web application files are stored or where the Tomcat deployment points.
Step 3: Open My App Server in Plesk
Use the My App Server extension to check whether a Java service already exists for the account. If available, choose the version that fits your application requirements.
ITA provides several ready-to-install Java and Tomcat versions, and some versions can also be uploaded and configured manually if your application needs a specific runtime.
Step 4: Select the correct Java and Tomcat version
Choose the Java version your JSP application needs. A modern app may require a newer JVM, while older applications may depend on a legacy runtime.
Be careful to match:
- Java version
- Tomcat version
- web.xml compatibility
- library dependencies
- application framework requirements
If you are not sure which version to use, check the application documentation or the build settings in your WAR package.
Step 5: Deploy the application to the subdomain
Upload your WAR file or application files to the directory connected to the subdomain. If the app is already packaged for Tomcat, deployment is often straightforward.
For a JSP application, make sure the following items are included if needed:
- JSP pages
- Servlet classes or compiled code
- WEB-INF folder
- libraries under WEB-INF/lib
- configuration files
Step 6: Verify context path and host mapping
Check whether the subdomain should open the app at the root URL or at a subpath. For example:
- app.example.com/
- app.example.com/myapp/
In Tomcat-based hosting, the context path must match the deployment structure. If the app appears in the wrong location, adjust the context configuration or rename the WAR file if your setup uses Tomcat’s default naming behavior.
Step 7: Restart or reload the Java service
After deployment or configuration changes, restart the app server if required. This ensures the new JSP files, class files, and configuration are loaded correctly.
With My App Server, service control is usually available from Plesk, so you do not need shell-level administration for basic actions.
DNS and SSL considerations for subdomains
A subdomain will not work reliably unless DNS is set correctly. If the DNS zone is managed inside the hosting account, Plesk usually creates the required record automatically when you add the subdomain. If DNS is external, you may need to add or update the record manually.
For JSP hosting, SSL is also important. Many applications handle login, form submission, or API traffic, so the subdomain should use HTTPS.
Check that:
- the subdomain resolves to the correct hosting endpoint
- the SSL certificate includes the subdomain
- HTTP redirects to HTTPS if required
- the app does not mix secure and non-secure resources
If the certificate does not cover the subdomain, browsers may show security warnings even if the application is otherwise working correctly.
Common problems with JSP subdomains in Plesk
The subdomain shows a default page instead of the app
This usually means the subdomain exists, but the application is not connected correctly to Tomcat. Check the document root, context path, and deployment folder.
JSP files download instead of running
This means Apache is serving the files directly instead of sending them to Tomcat. The subdomain needs to be linked to the Java application server, not just a static hosting directory.
404 errors after deployment
Possible causes include:
- wrong document root
- incorrect WAR name
- missing context mapping
- application files placed in the wrong folder
- Tomcat not restarted after changes
Old version of the app still appears
Clear the browser cache, check whether the deployment was overwritten, and confirm that the correct subdomain folder is active. If the app uses cached compiled JSPs, a restart may be necessary.
Subdomain works without HTTPS but not with HTTPS
This often indicates an SSL certificate issue or a redirect problem. Confirm that the subdomain is included in the certificate and that the Java app does not contain hardcoded insecure URLs.
Best practices for organizing subdomains with JSP hosting
Good structure makes JSP hosting easier to manage, especially when several subdomains are involved.
- Use one subdomain per application or environment.
- Keep production, test, and development separate.
- Name subdomains clearly, such as app, admin, test, or api.
- Store each app in its own deployment folder.
- Use matching Java and Tomcat versions across environments when possible.
- Monitor logs after every deployment.
- Use SSL for all public subdomains.
If your account contains several Java apps, a clear layout helps avoid conflicts between context paths, service settings, and file locations.
When to use a subdomain instead of a subfolder
For JSP hosting, a subdomain is often the better choice when the application behaves like a separate service. It gives cleaner routing and easier administration in Plesk.
Choose a subdomain if you need:
- a separate app entry point
- independent SSL handling
- its own Tomcat deployment
- staging or test separation
- a clearer URL for users or developers
A subfolder can still work for simpler content structures, but for servlet-based applications and multi-environment JSP hosting, subdomains are usually easier to manage.
FAQ
Can I use a subdomain for a JSP application in Plesk?
Yes. A subdomain can be linked to a JSP application as long as it is connected to a Java runtime and a servlet container such as Tomcat.
Do I need Tomcat for JSP hosting on a subdomain?
Yes, JSP pages require a servlet container. In ITA’s hosting setup, this is provided through My App Server with a private JVM and Tomcat instance.
Can each subdomain use a different Java version?
Depending on the hosting configuration, different subdomains or app setups can use different Java and Tomcat versions. This is useful when applications have different runtime requirements.
Why is my subdomain showing JSP source or a download prompt?
That usually means the subdomain is not routed through Tomcat correctly. Check the app server mapping and the hosting settings in Plesk.
Can I deploy a WAR file to a subdomain?
Yes. WAR deployment is one of the most common ways to publish a JSP or servlet application on a subdomain.
Do subdomains need separate SSL certificates?
Not always separate, but the certificate must cover the subdomain. A wildcard or multi-domain certificate can often be used if it includes the needed hostname.
Can I use a subdomain for testing before going live?
Yes. Many developers use subdomains for staging, QA, or pre-production versions of a Java application.
Summary
Subdomains in Plesk are a practical way to organize JSP hosting, especially when you need separate application endpoints, test environments, or clear Tomcat deployments. The key difference from regular hosting is that the subdomain must be connected not only to a folder, but also to a working Java app server.
With ITA’s My App Server extension, you can manage Apache Tomcat and a private JVM directly from Plesk, making it easier to host JSP, servlet, and WAR-based applications under a subdomain. The most important tasks are to create the subdomain, verify the document root, deploy the app correctly, choose the right Java version, and confirm that DNS and SSL are configured properly.
If the subdomain is mapped correctly, it becomes a clean and reliable entry point for your Java web application.