You can create a state service on the same server as the Exago application, or on a different one.
Warning
When using any of the state server configurations below, make sure to set
cookieless="false"
as the use of cookieless sessions with a state server is not supported.
If your state server is on a network, make sure you have allowed inbound connections to the state service on a port.
Note
Windows’ built-in State Server runs on port 42424 by default. It is suggested that this port is used for the configuration of the State Server. However, if preferred, this may be changed.
After applying these settings, the web server should be fully configured.
For more information about out-of-process session state, see the following external links:
Note
This section references
<WebApp>/
as a placeholder for the application’s install location. The default install location is/opt/Exago/
; however, this directory may be changed during installation.
A state service is installed as part of the mono runtime. Exago provides a script that can enable the state service to run headless, that can be downloaded from the Downloads page on the Support Site.
Using an ASP.NET State Service on Linux requires:
Perform these steps on the state server:
<WebApp>/StateService
) in order to isolate it from the rest of the application.sudo /opt/Exago/StateService/startStateServer.sh
Perform these steps on each Exago application server in the web farm:
<WebApp>/web.config
file for editing.<sessionState mode="InProc" cookieless="false" timeout="20" />
line and comment it out using XML comment tags <!--
and -->
.<sessionState mode="StateServer" cookieless="false" timeout="15" stateConnectionString="tcpip=localhost:42424" />
line just below the line in step 2.web.config
file should look like this:
<!--<sessionState mode="InProc" cookieless="false" timeout="20" /> -->
<sessionState mode="StateServer" cookieless="false" timeout="15" stateConnectionString="tcpip=0.0.0.0:42424" />
To use a port other than 42424 for the state service:
<WebApp>/web.config
file for editing.<sessionState mode="StateServer" cookieless="false" timeout="15" stateConnectionString="tcpip=localhost:42424" />
line with the correct port in the stateConnectionString attribute<WebApp>/web.config
./usr/lib/xsp/4.0/asp-state4.exe.config
for editing.<channel ref="tcp" port="42424" />
line inside of the <channels>
node. Modify the port attribute to the same port specified in step 2 above./usr/lib/xsp/4.0/asp-state4.exe.config
.sudo apt-get install gcc
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
make
make test
Note
Note that the
make
andmake test
steps will take several minutes to complete each.
make test
requires that Tcl be installed on the system. If not installed already, it can be installed withsudo apt-get install tcl
.
src/redis-cli -c -h <redis-host-name> -p 6379
<redis-host-name>
for the actual host name of the Elasticache for Redis instance created for step 1. The Redis CLI prompt should appear. If the session store is not correctly setup, this operation will time out instead.sessionState
node and modify it as follows:
<sessionState mode="Custom" customProvider="MySessionStateStore"> <providers> <add name="MySessionStateStore" type="Microsoft.Web.Redis.RedisSessionStateProvider" host="{redis-host-name}:6379" accessKey="" ssl="false" /> </providers></sessionState>
Substitute <redis-host-name>
for the actual host name of the Elasticache for Redis instance created for step 1.
Note
This article references
<WebApp>/
, as a placeholder for the application’s install location. The default install location is/opt/Exago/
however, this directory may have been changed during installation.
cd <WebApp>/bin
sudo wget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
sudo mono nuget.exe install StackExchange.Redis.Mono.StrongName
sudo mono nuget.exe install Microsoft.Web.RedisSessionStateProvider -Version 3.0.2
<WebApp>/bin
:
Microsoft.AspNet.SessionState.SessionStateModule.1.1.0
Microsoft.Web.RedisSessionStateProvider.3.0.2
StackExchange.Redis.Mono.StrongName.1.2.0
<WebApp>/bin
by issuing the following commands:
cd <WebApp>/bin/Microsoft.Web.RedisSessionStateProvider.3.0.2/lib/net452
sudo mv Microsoft.Web.RedisSessionStateProvider.dll <WebApp>/bin
cd <WebApp>/bin/StackExchange.Redis.Mono.StrongName.1.2.0/lib/net45
sudo mv StackExchange.Redis.StrongName.dll <WebApp>/bin
cd <WebApp>/bin/Microsoft.AspNet.SessionState.SessionStateModule.1.1.0/lib/Net462
sudo mv Microsoft.AspNet.SessionState.SessionStateModule.dll <WebApp>/bin
KEYS '*'
Keys for Exago should appear in the listing if the Admin Console loaded in step 8, similar to the figure below.