Skip to content

Set up Reverse-Proxy HTTP Server

Set up Reverse-Proxy to Forward REST Service Requests from Apachedft HTTP Server

It is recommended to proxy all requests to the MDCMS HTTP server through the Apachedft http server on the partition because:

  • no need to indicate the port number in the URL
  • no need to add another port number to the firewall rules
  • potentially take advantage of existing SSL configuration in the default http server

To configure the proxy:

  1. use WRKLNK to navigate to the /www location of the default server (usually named APACHEDFT)
  2. view the conf directory
  3. edit the httpd.conf file
  4. ensure the following modules are listed in the configuration. If missing then insert them into the configuration:
    LoadModule proxy_module /QSYS.LIB/QHTTPSVR.LIB/QZSRCORE.SRVPGM 
    LoadModule proxy_http_module /QSYS.LIB/QHTTPSVR.LIB/QZSRCORE.SRVPGM 
    LoadModule proxy_connect_module /QSYS.LIB/QHTTPSVR.LIB/QZSRCORE.SRVPGM 
    LoadModule proxy_ftp_module /QSYS.LIB/QHTTPSVR.LIB/QZSRCORE.SRVPGM 
    LoadModule proxy_balancer_module /QSYS.LIB/QHTTPSVR.LIB/QZSRCORE.SRVPGM
    
  5. add the following 3 lines to the configuration:
    ProxyPreserveHost On 
    ProxyPass /mdcms/ http://localhost:1901/mdcms/ 
    ProxyPassReverse /mdcms/ http://localhost:1901/mdcms/
    
    Replace 1901 with the port number you specified for the server mdcms is correct if the instance of MDCMS is MDCMS. If your instance is TEST for example, then replace all 4 occurrences of mdcms with mdcmstest. NOTE: mdcms in the URL is always the instance of MDCMS, regardless of the name of the server.
  6. save the configuration and restart the default server