To deploy a Java WAR package via the cPanel interface, navigate to cPanel's File Manager interface (cPanel >> Home >> Files >> File Manager) and perform the following steps:
- If the File Manager interface does not open in it, navigate to the
public_html
directory. -
Click + Folder. The New Folderwindow will appear.
Enter the new folder's name in the New Folder Name: text box and click Create New Folder.
Select your new folder in the center pane of the interface.
Click Upload.
Click Select File - Browse to the Java WAR package and click Open.
- Select the file and click Rename.
- Change the file extension from
.war
to.zip
and click Rename File. - Select the
.zip
file and click Extract. - Select the
.htaccess
file in thepublic_html
directory. - Click Edit.
- Click Edit in the Text Editor interface.
- Enter the following text in the text box:
SetHandler jakarta-servlet SetEnv JK_WORKER_NAME ajp13
11. Click Save Changes.
12. Access your Java application with thehttp://example.com/exampledirectory/examplejavaapplication
URL, where:example.com
represents your domain name.exampledirectory
represents the Java application's directory.examplejavaapplication
represents the Java application's name.
Note:If you do not see the
.htaccess
file inside yourpublic_html
directory, perform the appropriate steps for your version of cPanel & WHM:- For cPanel & WHM version 64 and earlier, exit and then reenter cPanel's File Manager interface (cPanel >> Home >> Files >> File Manager). When you reenter the interface, select the Show Hidden Files (dotfiles) checkbox.
- For cPanel & WHM version 66 and later, click Settings, select the Show Hidden Files (dotfiles) checkbox, and then click Save.