WURFL InFuze Module for Apache: User Guide
==========================================
This document is about the Apache server and how you, a developer or a system administrator, would install and configure the WURFL Module for Apache on Unix (Linux) systems.
Installing libwurfl
-------------------
In order for the Module to work it is **ESSENTIAL** that the `libwurfl` library is installed on your system.
`libwurfl` is provided in your Customer Vault/FileX.
If you have not already installed libwurfl,
instructions can be found [here](https://docs.scientiamobile.com/documentation/infuze/infuze-c-api-user-guide).
Release notes for each API can be found [here](https://docs.scientiamobile.com/documentation/changelog/infuze-api-change-log).
Install WURFL Apache Module on Ubuntu
-------------------------------------
Run the following commands to install the latest Apache software:
```shell
sudo apt-get update
sudo apt-get install apache2 apache2-threaded-dev
```
Download and install the WURFL Apache module `deb` package:
```shell
sudo dpkg -r apache-mod-wurfl
sudo dpkg -i mod_wurfl-1.9.4.0.Apache.2.2.32.x86_64.deb
```
Install WURFL Apache Module on RedHat/Fedora/CentOS
---------------------------------------------------
Run the following command to install the latest Apache Cache software:
```shell
sudo yum update
sudo yum -y install openssl-devel
sudo yum -y install pcre httpd
```
Download and install the WURFL Apache module `rpm` package:
```shell
sudo rpm -e apache-mod-wurfl
sudo rpm -i mod_wurfl-1.9.4.0.Apache.2.2.32.x86_64.rpm
```
Install WURFL Apache Module on Mac OS X
---------------------------------------------------
WURFL Apache module for Mac OS X is distributed as a tar.gz package containing
the `mod_wurfl.so` library and the sample configuration file `wurfl.conf`.
Unpack it and copy
• `mod_wurfl.so` in Apache modules folder (typically `/usr/libexec/apache2`)
• `wurfl.conf` in Apache configuration folder (typically `/private/etc/apache2/other`)
WURFL Data Snapshot
-----
To perform lookups, you will need a copy of your WURFL data snapshot (also referred to as the `wurfl.xml`). While there is one included in the release package, it is intended to be a sample and will not contain all of your licensed capabilities. Your licensed WURFL data snapshot can be accessed by [following these directions](https://docs.scientiamobile.com/guides/wurfl-snapshot-generator).
###
Configuration Guide
-------------------
Apache is configured by placing directives in plain text configuration files.
The main configuration file is usually called `httpd.conf` and includes the WURFL Apache Module configuration file `wurfl.conf`.
The installation package will place a sample `wurfl.conf` file in `/usr/share/wurfl` folder.
The `wurfl.conf` contains a `LoadModule` directive and a `
Syntax | Description | Availability |
---|---|---|
**WurflRoot** <string> | This defines the location (path) of the WURFL data file. | 1.4 |
**WurflUpdater** <string> <string> | Allows seamless update of WURFL engine with new data downloaded from Scientiamobile.
It takes two parameters: • the `data url` (taken from your personal Scientiamobile Vault account, choosing between two data file types: `.zip` or `.xml.gz`) Take care that `WurflRoot` file type and `WurflUpdater` `data url` file types match so you may need to change the `WurflRoot` file type accordingly. • the `updater checking frequency` (how often the updater checks for any new WURFL data file to be downloaded and used by the engine) which you can choose between `DAILY` and `WEEKLY`. In order to let the Updater perform its activities both the `WurflRoot` folder and file must be writable by Apache process. The `wurfl-updater.log` file in `WurflRoot` folder will contains details on Updater activity. |
1.8.3.1 |
**WurflPatch** <string> | This function to add one or more custom patch files to the WURFL repository. | 1.4 |
**WurflCacheNull** or **WurflCacheLRU** <num> |
In order to increase performance while processing real HTTP traffic, we suggest setting up a LRU cache. The LRU caching strategy will speed up lookup operations on User Agents that have already been processed by keeping them in a Least Recently Used map. By default the cache will be set to 30000 entries which accounts for 7 to 10 MB of additional memory usage. Specific concerns regarding memory usage apart, users are advised to size their cache generously (100,000 or more) to increase performance. For more information, please see [LRU Cache Mechanism](http://en.wikipedia.org/wiki/Cache_algorithms#Least_Recently_Used). | 1.4 |
**WurflRequestCapability** <string> | This function defines one or more WURFL Capabilities and/or WURFL Virtual Capabilities to be loaded in the memory run-time. Those WURFL capabilities/virtual capabilities will be loaded to Environment Variable for every HTTP requests. | 1.4 |
**WurflRequestProperty** <string> | Enables injection of WURFL Properties (see section WURFL Properties below) in the Environment Variable for every HTTP requests. | 1.8.2.0 |
Variable Name | Contents | Availability |
---|---|---|
wurfl_id | Contains the device ID of the matched device. It is injected by default so you don't have to specify it in a `wurfl_request_property` command | 1.4 |
wurfl_root_id | Contains the device root ID of the matched device. | 1.4 |
wurfl_isdevroot | Tells if the matched device is a root device. Possible values are "TRUE" or "FALSE" | 1.4 |
wurfl_useragent | The original useragent coming with this particular web request | 1.5.1 |
wurfl_api_version | Contains a string representing the currently used Libwurfl API version | 1.5.1 |
wurfl_info | A string containing information on the parsed wurfl.xml and its full path | 1.5.1 |
wurfl_last_load_time | Contains the UNIX timestamp of the last time WURFL has been loaded successfully. | 1.5.1 |
wurfl_normalized_useragent | The normalized useragent. | 1.5.1.3 |