How can we host a web server and ArcGIS Enterprise on same linux system?

344
1
03-12-2020 02:26 PM
MatthewLevey
New Contributor III

We are running ArcGIS Enterprise 10.7.1 on Red Hat Enterprise Linux. It is federated with both Server and Portal on the same system. Web Adaptor is configured and working and is required because we will need web-tier authentication. Because Web Adaptor only works with ports 80 and 443 we had to disable Apache (httpd) to avoid conflicts with Tomcat.

How can we use one system to host our web apps and ArcGIS Enterprise?

Matt Levey
SeaSpatial Consulting
0 Kudos
1 Reply
MatthewLevey
New Contributor III

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: 

  

  1. 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. 
  2. 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.
  3. 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.
  4. Removing and replacing strings is necessary because the proxy is not dynamic; it only forwards to one endpoint. This workflow makes the requests dynamic.
  5. 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
0 Kudos