Configuring reverse proxy by Apache

Feedback


Startup Apache

  1. Install Apache to the specified directory.
  2. After Apache is installed, it is in the startup status by default. You can set the status of "Start", "Stop", "Restart" by clicking the icon on the bottom-right corner of your screen.
  3. To verify the start status of Apache, there are two ways:

Configure Apache

Basic configuration

Go to [Apache install]\conf\, and open the httpd.conf file. You can change the contents to realize the configuration of reverse proxy:

  1. Remove the annotation "#" from the following two lines:

 LoadModule proxy_module modules/mod_proxy.so

 LoadModule proxy_http_module modules/mod_proxy_http.so

  1. Add new contents at the end:

ProxyPass /iserver http://192.168.17.16:8090/iserver

ProxyPassReverse /iserver http://192.168.17.16:8090/iserver

Request header of forward configuration

On the basis of the configuration above, the URL for forwarding in the request header should be set, too. Because if you don't set this URL, you still go to the original GIS server while you access to the reverse proxy server. There are three methods for setting the forwarding:

  1. Method One: Set ProxyPreserveHost. Under [Apache installation]\conf\httpd.conf, set ProxyPreserveHost to ON.
  2. Method Two: Set ProxyHost by the mod_headers plugin. There are two steps:

LoadModule headers_module modules/mod_headers.so

RequestHeader set ProxyHost "supermap.iserver.org:8000"

  1. Method Three: Modify the iServer configure file. Go to [SuperMap iServer Installation]\webapps\iserver\WEB_INF\iserver-system.xml, add a line under the <properties> node:

 <proxyHost>supermap.iserver.org:8000</proxyHost>

Access services

Before visiting http://supermap.iserver.org:8000/iserver, you should assign supermap.iserver.org a specified IP. So, you can set the IP via DNS; Or, you can add "192.168.17.16 supemap.iserver.org" to C:\Windows\System32\drivers\etc\hosts. After the IP is configured, you can get the same GIS services from the reverse proxy server at http://supermap.iserver.org:8090/iserver.