# DeviceAtlas HTTP Module / ISAPI Filter 2.1 Installation # Instructions on how to configure IIS with the DeviceAtlas Enterprise API. ### Dependencies ### - Internet Information Services web server version 6.0 and later. This setup provides supports for both 32/64 bits versions (x86 only). ### Installation ### To install DeviceAtlas Module / Filter please run registeriis.exe and follow the setup instructions. ### Setup ### After installation the HTTP Module (default) or the ISAPI Filter are automatically registered in IIS. The HTTP Module and/or the ISAPI Filter can be enabled for the whole web server or only for a specific web application. For IIS 7.x and above, HTTP modules are recommended instead of ISAPI Filters. The application pool used for the module must use following settings: - "No Managed code" as the .NET Framework Version. - If your system is running under x64 architecture, "Enable 32 bits Application" in the Advanced Settings must be set to False. ** IIS 7.x or later (HTTP Module) ** 1. Click on the Modules icon in the Features View to open modules overview. 2. Click on "Configure Native Modules..." in the Actions on the right side. 3. Click on "Register" button. 4. Navigate to the DeviceAtlas IIS installation folder and select the DLL file in the Module folder (DeviceAtlasIISModule.dll). 5. Select the DeviceAtlasModule and click OK. 6. The Module should appear in the overview of modules now. 7. Recycle the related Application Pool for the changes to take effect. Visit official IIS page for more information about HTTP Module settings. http://www.iis.net/configreference/system.webserver/modules ** IIS 6.x (ISAPI Filter) ** 1. Right-Click on the website name and select Properties. 2. On the ISAPI tab, click Add. 3. Navigate to the DeviceAtlas IIS installation folder and select the DLL file in the ISAPIFilter folder (DeviceAtlasIISFilter.dll). 4. Apply the changes and recycle the related Application Pool. Visit official IIS page for more information about ISAPI Filter settings. http://www.iis.net/configreference/system.webserver/isapifilters ### Configuration ### The configuration file for the DeviceAtlas API is located in the installation folder (config\DeviceAtlasIIS.ini) and it is automatically recognized by the IIS server. The following variables can be set: ** Data Files ** Set path for the Device Detection JSON file. ```shell DAJSONFILEPATH=/PATH/TO/JSON ``` Set path for the Carrier Identification data file. ```shell DACARRIERAPIFILEPATH=/PATH/TO/DATA ``` ** Cookie ** To use the Client Side Component with the IIS, the Javascript file located in ExtraTools/ClientSideProperties/ must be included on every webpage and following line must be present in the configuration file. The client side component will create a cookie with the client properties. The IIS module reads this cookie and merges the properties with the server side detected properties. ```shell DAPROPERTIESCOOKIE=DAPROPS ``` ** Properties ** To obtain only a subset of properties as the HTTP request headers instead of the full set, it is possible to use following configuration. This can improve performance. If these variables are not set, all available headers are returned. Device Detection ```shell DAINCLUDEHEADERS=id,vendor,model,mobileDevice,touchScreen,primaryHardwareType ``` Carrier Identification ```shell DAINCLUDECARRIERAPIHEADERS=networkBrand,networkOperator,countryCode ``` ** Configuration ** To disable the UAR properties and/or langage properties, the two following directives can be set. They are both enabled by default. ```shell DAINCLUDEUAPROPS=0 DAINCLUDELANGPROPS=0 ``` ### ASP.NET Example ### Following C# code illustrates how to leverage DeviceAtlas module headers. ```shell if (Request.Headers["HTTP_X_DEVATLAS_MOBILEDEVICE"] != null && Request.Headers["HTTP_X_DEVATLAS_MOBILEDEVICE"].ToString().Equals("1")) { // Do something for mobile devices } ``` ### Example Application ### An ASP example application is provided with the Client Side Properties library located in the installation folder ("sample" folder). It can be copied to the inetpub\wwwroot location or anywhere else if necessary. This application lists all avalable headers. To observe the module in action change the User-Agent header and watch the example display a new set of header/value pairs. ### Troubleshooting ### All events are written in Windows Event Log/Application Level (Source DeviceAtlasIISMessages). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - _ Copyright (c) DeviceAtlas Limited 2021. All Rights Reserved. _ <!-- HTML+JS for document formatting when opened in browser --> <div class="btn-group" id="main-menu" style="float:right"><a class="btn dropdown-toggle" data-toggle="dropdown" href="#">Menu<span class="caret"></span></a><ul class="dropdown-menu"><li><a href="README.html">Main</a></li><li class="divider"></li><li><a href="README.DeviceApi.html">Device Detection API</a></li><li><a href="README.DeviceApi-Web.html">Device Detection for Web</a></li><li><a href="README.DeviceApi-Config.html">Device Detection API Config</a></li><li><a href="README.CarrierApi.html">Carrier Identification API</a></li><li class="divider"></li><li><a href="README.Windows.html">C++ API and Windows</a></li><li class="divider"></li><li><a href="https://docs.deviceatlas.com/apis/clientside/latest/README.ClientSide.html" target="_blank">Client-side Component</a></li><li><a href="README.Apache2.html">Apache2 Module Installation</a></li><li class="divider"></li><li><a href="README.ConnectivityAnalyser-Apache2.html">Apache 2 Connectivity Analyser</a></li><li class="divider"></li><li class="disabled"><a href="README.IIS.html">HTTP Module / ISAPI Filter 2.1 Installation</a></li><li><a href="ApiDocs/index.html">DeviceAtlas ApiDocs</a></li></ul></div>