Child pages
  • How to Deploy Java Applications
Skip to end of metadata
Go to start of metadata

Overview

Many Java applications ship in Web Application Archive (WAR) packages that you can easily install on your server.

Note:

If your application does not exist in a WAR package, your system administrator must manually install it.

How to deploy Java WAR packages

Important:

  • Tomcat does not automatically deploy WAR files in the /home/username/public_html/$filename/ directory because EasyApache disables the unpackWARs option for security reasons.
  • The Apache Tomcat project provides a sample WAR file that you can use to verify that Java WAR packages function on your domain. For more information, view Tomcat's Sample Application website.

To deploy a Java WAR package, use either of the following methods:

To deploy a Java WAR package via the cPanel interface, navigate to cPanel's File Manager interface (Home >> Files >> File Manager) and perform the following steps:

  1. Select your public_html directory.
  2. Click New Folder and enter the new folder's name.
  3. Select your new folder in the center pane of the interface.
  4. Click Upload.
  5. Click Choose File.
  6. Browse to the Java WAR package and click Open.
  7. Select the file and click Rename.
  8. Change the file extension from .war to .zip and click Rename File.
  9. Select the .zip file and click Extract.
  10. Select the .htaccess file inside your public_html directory.

    Note:

    If you do not see the .htaccess file inside your public_html directory, perform the following steps:

    1. Exit cPanel's File Manager interface (Home >> Files >> File Manager)
    2. Refresh your cPanel interface.
    3. Click cPanel's File Manager interface (Home >> Files >> File Manager) and select the Show Hidden Files (dotfiles) checkbox.
    4. Click Go.
  11. Click Edit.
  12. Click Edit in the Text Editor interface.
  13. Enter the following text in the text box:

    SetHandler jakarta-servlet
    SetEnv JK_WORKER_NAME ajp13
  14. Click Save Changes.

  15. Access your Java application with the http://example.com/exampledirectory/examplejavaapplication  URL.

    Notes:

    • example.com represents your domain name.
    • exampledirectory represents the Java application's directory.
    • examplejavaapplication represents the Java application's name

Important:

To deploy a Java WAR package via the command line, perform the following steps:

  1. Upload your Java WAR package to your public_html directory.
  2. Run the unzip filename.war command to extract the package, where filename.war represents the name of your Java WAR package file.

  3. Open the .htaccess file with a text editor and add the following text:

    SetHandler jakarta-servlet
    SetEnv JK_WORKER_NAME ajp13
  4. Save your changes.
  5. Access your Java application with the http://example.com/exampledirectory/examplejavaapplication URL.

    Notes:

    • example.com represents your domain name.
    • exampledirectory represents the Java application's directory.
    • examplejavaapplet represents the Java application's name.

Your Java applications are ready to use.

Additional documentation

There is no content with the specified labels

There is no content with the specified labels