Configuring a proxy server with the MAP

The Media Access Proxy (MAP) supports the caching of both source and rendered images using a proxy server such as the caching proxy in WebSphere® Application Server Edge Components.

Caching of source images

The MAP supports two parameters related to caching: proxyHost and proxyPort. These parameters can be set when you install MAP. They can also be changed at any time by editing either the was_profile_root/installedApps/node_name/map.ear/map.war/WEB-INF/ics-config.xml file or the wp_profile_root/installedApps/node_name/map.ear/map.war/WEB-INF/ics-config.xml file, and then restarting the application server on which MAP is running. If these parameters are set, the MAP server will use the proxy server as a forward proxy.

When MAP requests an image from a remote web server, it will route the request through the forward proxy server. The source image will be cached by the forward proxy server and subsequent requests for the same image from MAP will be retrieved from the cache rather than the external web server.

If you use WebSphere Application Server Edge Components as your proxy server, it does not need any special configuration to support this usage, other than having caching enabled. To verify that caching is enabled, open the Caching Proxy administration window. Find the Cache Configuration folder under that the Cache Settings folder. Make sure that the Enable proxy caching box is checked.

Caching of transcoded images

The second use of a proxy server with MAP is as a reverse proxy. The proxy server can be configured as a reverse proxy that will pass requests to MAP only if the identical request has not already been cached.

Without the proxy server, an incoming request to MAP is in the following format:

http://fully qualified hostname of Media Access Proxy server:port/map/map_mode/img_dir/rule/image params
where

The complete URL, including the rule and parameters, must be used when determining if a transcoded image has already been cached or not. The parameters and rule are what distinguishes an image transcoded for one device from the same image transcoded for a different device. When WebSphere Application Server Edge Components are used as the reverse proxy server, there is a parameter that needs to be set on the Caching Proxy that tells it to include the parameters in the request when determining if the results should be cached. This parameter is called CacheQueries, and its setting is explained later in this topic.

For the examples listed later in this topic, the URL to the proxy server is http://proxyserver.ibm.com and URL to MAP is http://mapserver.ibm.com:9080/map/map (or http://mapserver.ibm.com:9080/map/ics).

When using a reverse proxy server, the proxy server name and port number should be used instead of the MAP server and port wherever the MAP server is referenced. For example, the mwp.icsServer parameter in the wp_profile_root/PortalServer/wp.mobile/wp.mobile.mwp/shared/app/config/mwp.properties file should contain

mwp.icsServer = http://proxyserver.ibm.com:80/map/map 

instead of

mwp.icsServer = http://mapserver.ibm.com:9080/map/map

Or,

mwp.icsServer = http://proxyserver.ibm.com:80/map/ics 

instead of

mwp.icsServer = http://mapserver.ibm.com:9080/map/ics

Also if the MAP URL is included in asset group policies, the URL should be changed to the URL of the proxy server and the asset group policies should be re-imported into the Multi-Channel Server database.

If you are using WebSphere Application Server Edge Components as your reverse proxy server, follow these steps to configure the Caching Proxy component:
  1. On the server where WebSphere Application Server Edge Components is installed, edit /etc/ibmproxy.conf.
  2. After this line:
    # *** START NEW MAPPING RULES SECTION ***

    insert the following:

    proxy       /map/map*  http://hostname:port/map/map_mode*
    where
    • hostname is the fully qualified host name of the server where MAP is installed.
    • port is the port number of the application server to which the MAP enterprise application is mapped.
    • map_mode is the Media Access Proxy mode that is configured (either map or ics).
  3. Insert the following line at the end of the file:
    CacheQueries     Always  http:// hostname:port/map/map_mode*
    where
    • hostname is the fully qualified host name of the server where MAP is installed.
    • port is the port number of the application server to which the MAP enterprise application is mapped.
    • map_mode is the Media Access Proxy mode that is configured (either map or ics).



Terms of use
(C) Copyright IBM Corporation 2012. All Rights Reserved.