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_htmldirectory. -
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
.warto.zipand click Rename File. - Select the
.zipfile and click Extract. - Select the
.htaccessfile in thepublic_htmldirectory. - Click Edit.
- Click Edit in the Text Editor interface.
- Enter the following text in the text box:
SetHandler jakarta-servlet SetEnv JK_WORKER_NAME ajp1311. Click Save Changes.
12. Access your Java application with thehttp://example.com/exampledirectory/examplejavaapplicationURL, where:example.comrepresents your domain name.exampledirectoryrepresents the Java application's directory.examplejavaapplicationrepresents the Java application's name.
Note:If you do not see the
.htaccessfile inside yourpublic_htmldirectory, 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.
