Page tree

Versions Compared

Key

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

...

Note
titleNotes:
  • This document only applies to systems that run cPanel & WHM version 76 or aboveand later.
  • You must possess root user -level access to create an Apache Tomcat® proxy.

...

Note
titleNotes:
  • When you assign Tomcat access to a cPanel user, the script assigns three two ports to the user. You can find these These port assignments reside in the the /etc/cpanel/cpuser_port_authority.json file file and the user's ~/root/ea-tomcat85/conf/server.xml file files.
    • The /root/ea-tomcat85/conf/server.xml file contains the ports on which the Apache JServ Protocol (AJP) support module listens. You must use a port on which AJP listens. For more information about AJP, read Apache's AJP documentation.
  • The following examples are not comprehensive. Many methods exist to proxy from Apache® to Tomcat. For more information about AJP, read Apache's AJP documentation.

To configure a proxy for EasyApache 4, create a virtual host include file for any domain for which you wish to proxy an application to Tomcat. Add your include file to the appropriate location in the  /etc/apache2/ directory.  For more information about Apache include files and their locations, read our our Modify Apache Virtual Hosts with Include Files  documentationdocumentation.

After you create or edit an Apache include userdata file, you must rebuild the httpd.conf file and restart Apache for the changes to take effect. 

...

Code Block
languagebash
/usr/local/cpanel/scripts/restartsrv_httpd

LiteSpeed Web Server

If you wish to To use LiteSpeed with Tomcat, your server must use the Tomcat instance's assigned port. LiteSpeed is not compatible with the ProxyPassMatch directive and will not proxy from the assigned port to port 80

...

To configure an app to use AJP, your entry might resemble the following example, where :

Note
titleNote:

In this example, /docs

...

 represents the Tomcat application and 11111 represents the user's AJP port number

...

.


Code Block
languagebash
linenumberstrue
<IfModule proxy_ajp_module>
	ProxyPass "/docs" "ajp://127.0.0.1:11111/docs"
</IfModule>

...

To set up a subdomain proxy, your entry might resemble the following example, where 11111 represents :

Note
titleNote:

In this example, /store represents the Tomcat application and 11111 represents the user's AJP port

...

number.


Code Block
languagebash
linenumberstrue
<IfModule proxy_ajp_module>
	ProxyPass "/" "ajp://127.0.0.1:11111/store"
</IfModule>

...

Your include file would resemble the following example, where 11111 represents the user's AJP port:

Note
titleNote:

In this example, 11111 represents the user's AJP port number.


Code Block
languagebash
linenumberstrue
<IfModule proxy_ajp_module>
	ProxyPassMatch "^/(.\.jsp|.\.do|(?:./)?servlets?/.)$" "ajp://127.0.0.1:11111/$1"
</IfModule>

...