Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
stylenone
printablefalse

Overview

Include Page
LIB:_EA4Tomcat
LIB:_EA4Tomcat

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

Note
titleNote:

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

How to deploy Java WAR packages

Warning
titleImportant:
  • This document only applies to systems that run EasyApache 3.
  • 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:

Localtab Group


Localtab
titlecPanel's File Manager Interface
Anchor
#filemanager
#filemanager

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
    titleNote:

    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
    titleNote:

    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
    titleNote:

    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
    titleNote:

    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:

    Code Block
    linenumberstrue
    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.


Localtab
titleCommand Line Interface


Warning
titleImportant:

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:

    Code Block
    linenumberstrue
    SetHandler jakarta-servlet
    SetEnv JK_WORKER_NAME ajp13


  4. Save your changes.
  5. Access your Java application with the http://example.com/exampledirectory/examplejavaapplicationURL.

    Note
    titleNotes:
    • 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

Localtab Group


Localtab
activetrue
titleSuggested documentation

Content by Label
showLabelsfalse
max5
showSpacefalse
cqllabel = "ea3" and label = "whm" and space = currentSpace()


Localtab
titleFor cPanel users

Content by Label
showLabelsfalse
max5
showSpacefalse
cqllabel = "ea3" and label = "cpanel" and space in ("DOC",currentSpace())


Localtab
titleFor WHM users

Content by Label
showLabelsfalse
max5
showSpacefalse
cqllabel = "ea3" and label = "whm" and space in (currentSpace(),"DOC")


Localtab
titleFor developers

Content by Label
showLabelsfalse
max5
showSpacefalse
cqllabel = "ea3" and space = "DD"