Step 3. session sharing between iPortal and proxy service
|
Feedback
|
It's essential to configure session sharing before proxy works successfully. Specifically, you need to configure to store the Cookie information of logged in users.
The independent proxy supports using Memcached to store session to implement the sharing between iPortal and independent proxy.
- Install and start Memcached service
See: Memcached configuration.
- Copy the related dependencies
Copy the following dependencies in [SuperMap iPortal Proxy installation directory]\lib directory to [SuperMap iPortal installation directory]\lib.
- memcached-session-manager-1.9.2.jar,
- memcached-session-manager-tc8-1.9.2.jar
- spymemcached-2.12.1.jar
- Open server.xml in %SuperMap iPortal_HOME%\conf directory, add the following code in<Host> node:
<Context path="/iportal">
<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
memcachedNodes="n1:127.0.0.1:11211"
sticky="false"
sessionBackupAsync="false"
lockingMode="all"
requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"
transcoderFactoryClass="de.javakaffee.web.msm.JavaSerializationTranscoderFactory"/>
</Context>
- <memcachedNodes>: Memcached server node information. The definition format of each node is <id>:<host>:<port>. If your Memcached server and iPortal are deployed on the same machine, the IP is 127.0.0.1; if they are not on the same machine, the IP here should be written into the IP address of the machine where the Memcached server is located. The default port number of Memcached is 11211, you need to configure it according to the actual situation. Multiple Memcached server nodes should be separated by spaces or commas.
- <sticky>: Specify the use of sticky or non-sticky session mechanism, and false should be filled here.
- <sessionBackupAsync>: Specify whether the session is saved to the Memcached server remotely.
- <lockingMode>: Specify the lock mode of the non-sticky session. Fill in all here, which means that the session will be locked when the request is made until the end of the request.
- <requestUriIgnorePattern>: Specify the regular expression of the request that does not change the backup session. For example, some static file requests do not need to trigger the session backup, you can use this attribute to define.
- <transcoderFactoryClass>: The class name of the code converter saved in the Memcached server, which is used to serialize and deserialize the session.
See: