How to Deploy Java Applications

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:

  1. If the File Manager interface does not open in it, navigate to the public_html directory.
  2. 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

  3. Browse to the Java WAR package and click Open.
  4. Select the file and click Rename.
  5. Change the file extension from .war to .zip and click Rename File.
  6. Select the .zip file and click Extract.
  7. Select the.htaccessfile in thepublic_htmldirectory.
  8. Click Edit.
  9. Click Edit in the Text Editor interface.
  10. 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 the URL, where: represents your domain name.

    exampledirectory represents the Java application's directory.

    examplejavaapplication represents the Java application's name.


    If you do not see the .htaccess file inside your public_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.
  • 172 Users Found This Useful
Was this answer helpful?

Powered by WHMCompleteSolution