Page tree
Skip to end of metadata
Go to start of metadata

Overview

Warning:

EasyApache 3 does not support Tomcat for new installations. EasyApache 4 does not support Tomcat and we do not plan to provide support in the future. 

 

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 (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 Folder window will appear.

    Note:

    In cPanel & WHM version 64 and earlier, click New Folder

  3. Enter the new folder's name in the New Folder Name: text box and click Create New Folder.
  4. Select your new folder in the center pane of the interface.
  5. Click Upload.
  6. Click Select File.

    Note:

    In cPanel & WHM version 64 and earlier, click Choose File

  7. Browse to the Java WAR package and click Open.
  8. Select the file and click Rename.
  9. Change the file extension from .war to .zip and click Rename File.
  10. Select the .zip file and click Extract.

    Note:

    This function only works with the .zip format if Zip exists on your server. System administrators can run the yum install zip command to install the Zip PHP module

  11. Select the .htaccess file in the public_html directory.

    Note:

    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.
  12. Click Edit.
  13. Click Edit in the Text Editor interface.
  14. Enter the following text in the text box:

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

  16. Access your Java application with the http://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.

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

Error rendering macro 'contentbylabel' : parameters should not be empty

There is no content with the specified labels

There is no content with the specified labels