[Java] Make Apache and Tomcat work together on CentOS 8 in no time

less than 1 minute read

Overview

Classic material

environment

  • CentOS 8.2
  • http 2.4
  • tomcat 8.0

Premise

It is assumed that apache and tomcat have been set up.

  • Apache configuration file: /etc/httpd/conf
  • tomcat configuration file: /usr/java/tomcat8/conf

procedure

Create the following configuration file. For the time being, transfer all.

/etc/httpd/conf.d/proxy.conf


ProxyPass / ajp://localhost:8009/

Do the following (no spells)

/usr/sbin/setsebool -P httpd_can_network_connect 1

Comments Off To Crush 8080

/usr/java/tomcat8/conf/server.xml


    <!--
    <Connector executor="tomcatThreadPool"
               port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    -->

Tomcat restart

systemctl restart tomcat

You should be able to see the tomcat home screen at the URL: http://[IP address]/.

reference

  • https://confluence.atlassian.com/bitbucketserverkb/permission-denied-in-apache-logs-when-used-as-a-reverse-proxy-790957647.html