To answer my own question, this is how we resolved the problem of hosting web pages and running web adaptor on the same Linux machine, in our case Red Hat Enterprise Linux 7.6:
- It turns out that Tomcat can be configured as a reverse-proxy server using a servlet. I installed HTTPProxyServlet from http://www.servletsuite.com/servlets/httpproxy.htm and configured it to forward requests with '/apps' in the URL to Apache httpd. There are other more up-to-date servlets out there but this one was simple to configure and use.
- The Servlet (described above) matches a url path string (e.g. /apps), deletes it and everything after it, and forwards it to the web-server (httpd aka Apache) at http://yourserver.domain:port. Note it is not using SSL and in this case is listening to port 8080 (via a Virtual Host/Server). Port 8080 is blocked from external IP addresses for security.
- A ReWriteRule was added to httpd's Directives file (/etc/httpd/conf/httpd.conf) that adds the removed paths and whatever string was in the original url after them. So the final url looks like: '_/path1/path2/SomeStringHere' to follow the file system path to the web app content.
- Removing and replacing strings is necessary because the proxy is not dynamic; it only forwards to one endpoint. This workflow makes the requests dynamic.
- Currently it is necessary to have the trailing slash at the end of the string. If this '/' is missing any relative paths in the web app will be broken and the app will not load completely. IIS seems to do this automatically but I haven't figured out how to get httpd see the current directory as a root directory and load other content. Any suggestions on how to fix this would be appreciated.
Hopefully this helps others who have a similar situation. Good luck!
Matt Levey
SeaSpatial Consulting