Skip to main content

Apache2 and Tomcat9 Configuration

Comments

6 comments

  • bobc02
    I'm the OP, with log info that I forgot to post. Apache2 error_log is showing proxy issues (below). It's complaining about missing LoadModules, but I had tried adding four modules to post_virtualhost_global.conf, but Apache2 reported that all of them were already loaded, so I took them out. Apache2 error_log: [Tue Jun 04 02:09:25.428602 2019] [proxy:warn] [pid 28110] [client 24.xx.xx.85:53691] AH01144: No protocol handler was valid for the URL / (scheme 'ajp'). If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule. [Tue Jun 04 02:09:25.428702 2019] [proxy:warn] [pid 28110] [client 24.xx.xx.85:53691] AH01144: No protocol handler was valid for the URL /500.shtml (scheme 'ajp'). If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule. [Tue Jun 04 02:09:25.733311 2019] [proxy:warn] [pid 28112] [client 24.xx.xx.85:53693] AH01144: No protocol handler was valid for the URL /favicon.ico (scheme 'ajp'). If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule. [Tue Jun 04 02:09:25.733418 2019] [proxy:warn] [pid 28112] [client 24.xx.xx.85:53693] AH01144: No protocol handler was valid for the URL /500.shtml (scheme 'ajp'). If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.
    0
  • cPanelMichael
    Hello @bobc02, EasyApache 4 only supports Tomcat version 8.5 at this time. We document Tomcat installation steps and usage notes on the link below: Tomcat - EasyApache 4 - cPanel Documentation As I understand, you're attempting to manually install Tomcat version 9. This is an unsupported workaround and is not recommended due to the potential for errors and functionality issues. Can you share some information about the specific features or changes in Tomcat 9 that are leading you to attempt a manual installation? Thank you.
    0
  • bobc02
    Hello @bobc02, EasyApache 4 only supports Tomcat version 8.5 at this time. We document Tomcat installation steps and usage notes on the link below:
    0
  • cPanelMichael
    Hello Bob, Thanks for sharing the additional information!
    I have been using standard Apache2 and Tomcat9 docs for my info, thinking, for example that ports 8005 and 8009 are used. But the doc references the port_authority json file, which is empty: [root@dev ~]# ls -al /etc/cpanel/cpuser_port_authority.json -rw-r----- 1 root root 0 May 22 22:50 /etc/cpanel/cpuser_port_authority.json
    Is that json file empty by mistake? Or, is there something I must do in WHM EasyApache 4 to populate it. Create a profile?

    The Port Authority script included with cPanel & WHM allows you (as root) to assign one or more 5-digit port numbers for a user's exclusive use: The cpuser_port_authority script - Version 80 Documentation - cPanel Documentation This lets cPanel users make use of an specific port number when configuring their application, without concern that another cPanel user is already using the same port number. Thank you.
    0
  • bobc02
    I'm the OP. I have finished the Apache2 and Tomcat9 configuration, and wanted to share my experience for others. It, basically, came down to studying the generated httpd.conf file, for the Include file hooks, uncommenting the appropriate one(s), adding the include file(s) at the specified path(s), and adding an AJP connector to Tomcat's server.xml. connector. For the Include file hooks, look in the generated httpd.conf. Find the VirtualHost directive that applies to your situation, and locate the "Include /etc/apache2/conf.d/..." line. In SSH, do a mkdir to that Include file path, and set the ownership and permissions appropriately. If the Include lines are commented (# Include /etc/apache2/conf.d/...) you'll need to go into WHM EasyApache 4, and select a profile, to get them uncommented - at least I think you do it this way; I took a different path. Down the Include file path, I added a file named custom_include.conf, this is its contents: LoadModule proxy_ajp_module /usr/lib64/httpd/modules/mod_proxy_ajp.so SecRuleEngine On SecStatusEngine On ProxyPass "/" "ajp://127.0.0.1:8009/"
    Updating Tomcat's server.xml, involved adding some connectors. My server.xml, may not be exactly what other's need. I force all website traffic through HTTPS, so I've added an elaborate 8443 connector. The AJP connector is required, though, because, as you see in custom_include.conf, the Apache proxy redirects to Tomcat's AJP connector. Here are all my Tomcat connectors:
    The docs that cPanelMichael posted earlier in this topic, are the basis for the changes I made. I hope this helps. Bob
    0
  • cPanelMichael
    Hello Bob, Thanks for sharing!
    0

Please sign in to leave a comment.