Skip to content
This repository has been archived by the owner on May 17, 2022. It is now read-only.

System environment

Yves Blatti edited this page Jan 30, 2020 · 1 revision

System environment

As the component Map is a javascript base viewer consuming remote OGC web services, you have to handle the same origin policy in your system configuration to avoid crossdomain restrictions.

Two ways to configure your system :

This solution is not recommanded due to security holes that this script introduces into EasySDI solution. To handle same origin policy and assure remote web services security access, we do recommand to use the EasySDI Proxy combined with a web server proxy/gateway extension, like apache proxy_module.

Apache configuration Let's explained by the example : You are hosting your Joomla site at the following address : www.my-easysdi.com. And having your EasySDI Proxy servlet at this one : www.proxy-easysdi:8080/proxy. In order to access your proxied services into the map viewer, the two have to be in the same domain, so define www.my-easysdi.com/proxy as EasySDI Proxy URL would be the solution. To do that :

  1. Enable proxy_module : open the Apache configuration file [Apache root]/conf/httpd.conf, remove '#' character in front of, or add the all following line LoadModule proxy_module modules/mod_proxy.so

  2. Define your reverse proxy at the end of the configuration file :

ProxyPass /proxy www.proxy-easysdi:8080/proxy
ProxyPassReverse /proxy www.proxy-easysdi:8080/proxy

With this configuration, the map viewer makes requests for content in the name-spaced of the reverse proxy. The reverse proxy then sends those requests to the actual Proxy location and returns the content as if it was itself the origin.

Proxy Service configuration The Map viewer will send GetCapabilities requests on the remote services adding to the map to retreive for each available operations the URL to query. With the use of the Apache module_proxy, those url won't be overwrite with the reverse proxy domain (this is not the purpose of this module) and will expose URL of the original location. The following map requests for those operations will failed due to crossdomain restriction. To get around this problem, the EasySDI Proxy propose a 'Host translator' option for each proxied service (called Virtual Service, see EasySDI component Service documentation). Defining your reverse proxy URL as the host translator, will allow the EasySDI Proxy to overwrite all the URL contained in the capabilities document and then all the requests from the Map viewer to be correctly directed. To follow the previous example :

<GetFeatureInfo>
  <Format>application/vnd.ogc.gml</Format>
  <DCPType>
   <HTTP>
    <Get>
      <OnlineResource xlink:href="http://www.my-easysdi.com/proxy/ogc/myvirtualwms?"/>
    </Get>
    <Post>
     <OnlineResource xlink:href="http://www.my-easysdi.com/proxy/ogc/myvirtualwms?"/>
    </Post>
   </HTTP>
  </DCPType>
</GetFeatureInfo>