Configuring SQL, IIS and services
When a user interacts with the iMIS website, information and settings related to that user are held on the server in a session. By default, the session is held in memory, but it is also possible to configure the website to hold the session information in a SQL Server database.
Users might want to consider this option if interested in reducing memory overhead in their web server. If using a web farm to allow sharing across servers, using this option will allow users to access settings through the database. SQL Server Sessions will also allow session settings to be maintained even if a web server needs to be recycled. However, because this option always accesses session settings from the database, performance might be slightly slower.
NoteThese instructions are of a technical nature, and are only be performed by a website administrator. Further information about SQL Server sessions is available on the Microsoft website.
NoteThis feature is available for Advanced Accounting Console and the Mobile, Member, and Staff sites.
Before making this change to your live website, make any desired changes on a test copy of the live site and test thoroughly to ensure that the configuration changes meet your unique needs. Pay special attention to third-party content items, as they might not have been tested to run with sessions in SQL server.
WarningDo not configure iMIS for SQL Server Sessions if you are currently using Process Manager.
Adding SQL Session database to SQL Server
The SQL Session database is separate from the iMIS database. It can be found on the web server or on another server if you use a web farm.
- Depending on your system, run the command to add a special SQL Session database called ASPState to your SQL Server.
- 64-bit operating systems
- 32-bit operating systems
- Open SQL Server Management Studio to see the new ASPState database.
- If you are using trusted connections to connect to the server, change the ownership of the state database to sa, or equivalent user if sa is not being used, after creation. In SQL Server Management Studio run the following:
- If you are using SQL authentication, create a user and password for session state to use. At minimum, this user should have permissions to execute the stored procedures in the ASPState database.
You might want to put this into a batch file with a .cmd extension and run it, or open a command prompt and paste it into the command line.
"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regsql" -S <server> -U <uid> -P <pwd> -ssadd -sstype p
"C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regsql" -S <server> -U <uid> -P <pwd> -ssadd -sstype p
Replace <server> with your server name, <uid> with a valid SQL Server userID, and <pwd> with the appropriate password.
use ASPState exec sp_changedbowner ‘sa’, ‘true’
📘 Note
If you want to set your session back to memory, use the following:
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;user id=sa;password=qa" cookieless="false" timeout="120"/>If you would like to have a session longer or shorter than the default of 120 minutes, change the timeout value.
Configuring a non-standard SQL server port
The iMIS database connection string is parsed by the iMIS Desktop Data Source Name (DSN) when the database gets built from the web.config file on the iMIS app server. For example, if you have server name (or IP) 1434 in the connection string, when the ODBC gets auto-created by the iMIS Desktop, it parses the connection string but sees the comma separating the database server from the port number, which is interpreted as the database name. The value after the comma is used as the database name in the ODBC; in this case, 1434, which is not the database name, but the SQL port number.
To fix this, create a SQL Alias on your iMIS SQL Server:
- Go to SQL Server > SQL Server Configuration Manager > SQL Native Client Configuration > Aliases > New Alias.
- Enter the following configurations:
- Alias Name <serveralias>
- Port No. <port>
- Protocol TCP/IP
- Server <servername>
- Change the iMIS database connection string in the web.config file to use the SQL Alias name instead of "SQLSERVERNAME,Port#".
📘 Note
For more information on creating aliases, see Create or delete a server alias for use by a client.
Updating Web.Config for SQL Server Sessions
Do the following to update the web.config files for SQL Server Sessions:
- Replace the existing sessionState entry with one similar to below. Replace
<server>with your server name,<uid>with a valid SQL Server userID, and<pwd>with the password: - If using SSRS reports, add the trust entry into the system.web section:
<sessionState mode="SQLServer" sqlConnectionString="data source=<server>;user id=<uid>;password=<pwd>" cookieless="false" timeout="120"/>
</assemblies> </compilation> <trust legacyCasModel="true" level="Full"/> <httpRuntime executionTimeout="3600" maxRequestLength="10240"
Configuring IIS 7.5 or IIS 8 to run iMIS
These configuration settings apply to all systems running IIS 7.5 or 8 (Windows Vista/7, Windows Server 2008 R2, and Windows Server 2012) where iMIS server components are installed.
The iMIS installer applies the setting for the application pool setting only. The iMIS installer does not verify that the application roles are installed. You can follow these procedures if you are configuring your system manually or want to implement IIS configuration tips.
Installs to the root of a website are no longer supported. If a previous install used the default website, you are required to enter a new virtual root name. Enter the name and click Next. The upgrade converts the default website to use the virtual root name you provided. See Redirecting to the virtual directory URL for information about redirecting the URL of your default website to the URL of the virtual directory.
Specifying the .NET application pool
Do the following to specify the .NET application pool:
- Go to Start > Administrative Tools > Internet Information Services (IIS) Manager.
- In the Connections pane, select the iMIS website.
- In the Actions pane, select Basic Settings.
- Click Select.
- From the drop-down list, select iMISApp .NET AppPool.
- Click OK on all dialog boxes.
- Restart IIS.
Specifying a custom error page
Do the following to specify a custom error page:
- Go to Start > Administrative Tools > Internet Information Services (IIS) Manager.
- In the Connections pane, select your website.
- In the Home pane, under IIS, double-click Error Pages.
- Double-click the entry for the 404 status code.
- Select Execute a URL on this site.
- Edit the URL to refer to the 404.aspx page, for example, /404.aspx.
- Click OK.
- In the Home pane, under IIS, double-click Default Document. If there is no entry for Default.aspx, add it.
Configuring TLS
TLS is a protocol layer placed between a reliable connection-oriented network protocol layer (TCP/IP) and an application protocol layer (HTTP).
Enabling TLS provides extra security for the site by encrypting information. This security is especially important at checkout, where users may enter credit card information.
An administrator can enable TLS for content item-based sites at the Content Record level. For any content record that contains a content item that you want to operate using TLS, enable the Content is secure (https://) property.
After June 30, 2018, all entities must have stopped use of SSL/early TLS as a security control, and use only secure versions of the protocol. For more information, refer to Removing Desktop-client TLS 1.0 dependence.📘 Note
Optimizing timeouts on iMIS servers
You can extend the timeout settings on an iMIS server to optimize it for testing and demo usage. Extending timeouts prevents problems that come from letting iMIS sit idle for long periods.
📘 Note
Do not set excessive timeouts (especially the session timeout) on production sites: idle sessions sitting for long periods can exhaust the server’s memory.
Many apparent iMIS problems are caused by timeout settings, both default session timeouts in iMIS-related web.config files and timeout settings in ASP.NET itself.
- Timeouts defined in each application’s web.config file:
- The idle session timeout ends a user’s iMIS session after 20 minutes of inactivity.
- The idle authentication ticket timeout defaults to 30 minutes, unless the Remember Me option (a checkbox on the login screen) is enabled.
- Timeouts for the ASP.NET application pool:
- The Shutdown worker processes timeout kills idle processes after 20 minutes. If the iMIS server gets no request within 20 minutes, it restarts iMIS, and the application startup takes time.
- The Recycle worker processes timeout forces a complete recycle (restart) every 1740 minutes (29 hours), even for non-idle worker processes.
🚧 Warning
Do not overdo the fix. Excessive timeouts worsen the performance and memory usage of your server, and disabling Application Pool recycling slows performance over time, as memory cannot be released by Task Manager’s w3wp.exe process, which is used by IIS to launch .NET application pool processes. Therefore, make changes carefully, and test their impacts.
Increasing session-specific timeouts
If Page Not Available errors or logon/password-related windows are displayed erroneously, increase the session-specific timeout in web.config files associated with iMIS.
Do the following to increase session-specific timeouts:
- On the iMIS server, open each iMIS-related web.config file for editing:
- iMIS default locations:
- C:\Program Files (x86)\ASI\iMIS\Net
- C:\AsiPlatform\Asi.Scheduler_[your instance]
- iMIS default locations:
- Locate the
<sessionState>element and modify the timeout attribute, for example: - Repeat this process for each iMIS server.
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;user id=sa;password=" cookieless="false" timeout="120" />
📘 Note
For high traffic, it is recommended to set this value between 60 to 240 minutes. For low traffic, set between 720 to 1440 minutes.
Improving application pool timeouts
Do the following to improve application pool timeouts:
- Go to Start > Administrative Tools > Internet Information Services (IIS) Manager on the iMIS server.
- In the Connections pane, select Application Pools.
- In the Application Pools pane, select iMISapp AppPool.
- In the Actions pane, select Edit Application Pool > Recycling.
- In the Recycling Conditions window, ensure all checkboxes are clear (unchecked).
- Click Next, then click Finish.
- In the Actions pane, select Edit Application Pool > Advanced Settings.
- In the Advanced Settings window, under Process Model, set Idle Time-out (minutes) to zero (0).
- Click OK.
- In the Connections pane, select Sites.
- Select Default Web Site.
- In the Actions pane, select Manage Web Site > Advanced Settings.
- In the Advanced Settings window, under Connection Limits, set Connection Time-out (seconds) to zero (0).
- Click OK.
- Restart IIS.
📘 Note
Do not select Recycle.
Resetting the application pool recycle schedule
iMIS application pools will recycle at a randomly generated time each day between 1:00 am and 3:00 am. Tasks that are scheduled during this time might be interrupted, and interrupted tasks cannot be recovered. You can edit the applicationHost.config file to reset this application pool recycle schedule. Do the following:
- Open the applicationHost.config file for editing. The file can be found in the C:\Windows\System32\inetsrv\config directory.
- Locate the following snippet of code:
- Add a new value for the
<schedule>parameter. For example, if you wanted the application pool recycle to initiate at 1:15 am, change the<system>parameter value to the following:
<add name="AsiSchedulerPool" autoStart="true" enable32BitAppOnWin64="false" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated" startMode="AlwaysRunning"> <recycling> <periodicRestart time="00:00:00"> <schedule> <add value="02:32:00" /> </schedule> </periodicRestart> </recycling>
<schedule> <add value="01:15:00" /> </schedule>
Enabling concurrent Casual and Full access by separating authentication cookies
If your staff users need to run both administrative and staff views on the same workstation concurrently, then you need to create a separate Casual site (virtual directory) for them.
To enable Casual and Full access at the same time, you must separate the authentication cookies. This lets you open administrative and staff clients simultaneously for different license levels, without logins colliding.
Do the following to separate authentication cookies:
- Create separate virtual directories for each view:
- Copy the ..\ASI\iMIS\Net folder to another location (such as ..\ASI\iMIS\Net2).
- In IIS Admin, create a new virtual directory (such as iMISCasual) and point it at the new folder.
- Configure the sites to use different authentication cookie names:
- In each web.config file, locate the following section:
- Change the name attribute’s value to be unique (such as LoginFull, LoginCasual, or LoginPublic) for each site, then save and close the files.
- Point your administrative view at one site, such as iMIS, and your browser at the other, such as iMISCasual, as needed.
<authentication mode="Forms"> <forms name="Login" loginUrl="~/AsiCommon/Controls/Shared/FormsAuthentication/Login.aspx" /> </authentication>
