> ## Documentation Index
> Fetch the complete documentation index at: https://kb.mochahost.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PHP + Java Hosting on Shared and Private JVM (cPanel)

## How to host PHP and Java under the same cPanel account

Please follow the instructions below in order to host both PHP and Java under the same cPanel account.

### Shared Tomcat plans:

You can map Tomcat to serve JSP content only within your public\\\_html folder, every other directory under the website will be processed by PHP.

### Private JVM (Tomcat):

To get support for PHP you will need to create a sub-domain for your website which is not mapped to Tomcat, so it will be processed directly by Apache (PHP). To do that please follow the steps below:

1. Login to your Cpanel.

![](http://tutorials.my-virtual-panel.com/cpanel_error_log/1_cpanel_error_log.png)

2. Click **Subdomains**.

![](http://tutorials.my-virtual-panel.com/java_php/2_jvmphp.png)

3. Fill in the sub-domain name and choose **Create**.

![](http://tutorials.my-virtual-panel.com/java_php/3_jvmphp.png)

4. Go to the **Private JVM** under MOCHA TOOLS.

![](http://tutorials.my-virtual-panel.com/java_php/4_jvmphp.png)

5. Mapp the sub-domain if you wish to be processed by Tomcat, or leave it unmapped if you wish to be processed by PHP.

![](http://tutorials.my-virtual-panel.com/java_php/5_jvmphp.png)
