In a CentOS 7 server, I am trying to set up httpd to act as a reverse proxy for tomcat. I have httpd running perfectly in the sense that I type in http/mydomain.com and it serves up static content located in the designated DocumentRoot. I also have tomcat running perfectly in that tomcat serves up a designated war file when I type in http/my.server.ip:8080. The war file redirects all unauthenticated users to the /login url pattern so they can sign in before using the site. This works fine in tomcat. But when I comment out the DocumentRoot and add ProxyPass and ProxyPassReverse instead, I get the following error message in the browser:
Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /login.
Reason: DNS lookup failure for: server.ip.address:8009login
My VirtualHost is as follows:
<VirtualHost *:80>
ServerName www.mydomain.com
ServerAlias mydomain.com
ErrorLog /var/log/httpd/mydomain_com_error.log
CustomLog /var/log/httpd/mydomain_com_requests.log combined
ProxyPass / ajp://server.ip.address:8009
ProxyPassReverse / ajp://server.ip.address:8009
</VirtualHost>
I also made sure to uncomment the following connector in server.xml:
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
You can read the entire server.xml file located in a file sharing site by clicking on this link.
Apache is obviously talking to tomcat and working with the war file, because apache figured out how to get re-directed to the /login url pattern. But how can I fix my configuration so that /login and other relative urls get served correctly?
I am not certain whether or not mod_jk is installed.