operating handbook wope 6.0 · 2017. 6. 30. · table 3.1. verification stage: apache tomcat...

74
WOPE 6.0.30 Operating handbook

Upload: others

Post on 13-Nov-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

WOPE 6.0.30

Operating handbook

Page 2: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Operating handbook

WOPE 6.0.30 Operating handbook

Copyright Backelite 2015

Page 3: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

iii

1. Introduction 11.1. WOPE operational diagram - Request and response path ............................................... 1

2. Installing WOPE using the GUI installer 32.1. Download the installer ................................................................................................... 32.2. Run the installer ........................................................................................................... 3

3. Getting Started for a server installation 53.1. Prerequisite : obtaining a license ................................................................................... 53.2. Stage 1: Checking the configuration .............................................................................. 53.3. Stage 2: Checking the Apache Tomcat installation ......................................................... 63.4. Stage 3: Creating the wope.ini file ................................................................................. 83.5. Stage 4: Registering WOPE with Apache Tomcat ........................................................... 83.6. Stage 5: Check the availability of HTML pages ............................................................. 103.7. Stage 6: Declaring your application server ................................................................... 11

4. Installing WOPE on Apache Tomcat 134.1. Requirements .............................................................................................................. 13

4.1.1. Java ................................................................................................................ 134.1.2. Installing Tomcat 7.0.x ...................................................................................... 13

4.2. Installing the WOPE WebApp ...................................................................................... 144.2.1. Creating the configuration file ........................................................................... 144.2.2. License installation ........................................................................................... 154.2.3. Installing WOPE ............................................................................................... 154.2.4. Configuring the server's UTF-8 encoding ........................................................... 174.2.5. Configure the server for WebP image generation ............................................... 17

4.3. Verifying the installation ............................................................................................... 174.4. Session replication ...................................................................................................... 18

5. Installing WOPE with IBM Websphere Application Server 195.1. Requirements .............................................................................................................. 19

5.1.1. Application server ............................................................................................. 195.2. Installing the WOPE WebApp ...................................................................................... 19

5.2.1. Creating the configuration file ........................................................................... 195.2.2. License installation ........................................................................................... 195.2.3. Installing WOPE ............................................................................................... 205.2.4. Configuring the server's UTF-8 encoding ........................................................... 225.2.5. Configure the server for WebP image generation ............................................... 23

5.3. Verifying the installation ............................................................................................... 24

6. Installing WOPE with JBOSS Wildfly Application Server 256.1. Requirements .............................................................................................................. 25

6.1.1. Application server ............................................................................................. 256.2. Installing the WOPE WebApp ...................................................................................... 25

6.2.1. Creating the configuration file ........................................................................... 256.2.2. License installation ........................................................................................... 266.2.3. Prepare JBOSS for WOPE ............................................................................... 266.2.4. Configuring the server's UTF-8 encoding ........................................................... 276.2.5. Configure the server for WebP image generation ............................................... 27

6.3. Verifying the installation ............................................................................................... 28

7. Configuring WOPE 317.1. Configuring a target site .............................................................................................. 317.2. Displaying errors ......................................................................................................... 32

7.2.1. Displaying errors in development mode ............................................................. 327.2.2. Displaying Javascript logs ................................................................................. 327.2.3. Displaying errors in production mode ................................................................ 33

Page 4: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Operating handbook

iv

7.3. WOPE options related to your mobile site .................................................................... 357.3.1. Redirecting a non-mobile device to another site ................................................. 357.3.2. Configuring several different mobile sites using the same WOPE instance (mul-ti-site configuration) .................................................................................................... 36

7.4. Configuring data exchange between the mobile device, WOPE and the business appli-cation ................................................................................................................................ 37

7.4.1. Sending information about a device's features ................................................... 377.4.2. User identification ............................................................................................. 377.4.3. Configuring WOPE with a load-balancer ............................................................ 397.4.4. Managing the browser cache with WOPE .......................................................... 397.4.5. HTTPS configuration between WOPE and the HTML application ......................... 407.4.6. Disable the processing of certain pages by the WOPE engine ............................. 42

7.5. Domain alias settings .................................................................................................. 427.6. Audience measurement ............................................................................................... 43

7.6.1. Configure audience measurement for AT Internet ............................................... 437.6.2. Configure audience measurement for Google Analytics ...................................... 44

8. Operating WOPE 458.1. Activating JMX (Java Management Extensions) ............................................................ 458.2. Caching images with WOPE ........................................................................................ 458.3. Forcing a rewrite of virtual folders ................................................................................ 468.4. Logging installation ..................................................................................................... 46

8.4.1. Analyzing the application logs ........................................................................... 468.4.2. Collecting enhanced visitor logs in Apache format .............................................. 48

9. Best practices for securing and optimizing WOPE 519.1. Security best practices ................................................................................................ 51

9.1.1. Remove unused webapps from your application server ...................................... 519.1.2. Enable requests logging ................................................................................... 519.1.3. Make sure that the user source address is properly detected .............................. 519.1.4. Recognize secure users ................................................................................... 529.1.5. Disable or firewall JMX access ......................................................................... 529.1.6. Disable debugging ............................................................................................ 529.1.7. Enable SSL between WOPE and your application. ............................................. 52

9.2. Performances .............................................................................................................. 529.2.1. Use a recent Java Virtual Machine .................................................................... 529.2.2. Tune your Java Virtual Machine ........................................................................ 529.2.3. Tune the number of maximum connections to your target ................................... 539.2.4. Tune timeouts .................................................................................................. 539.2.5. Enable minification and gzip smartly .................................................................. 549.2.6. Leverage the browser's cache .......................................................................... 54

10. Considerations when running WOPE in a PCI DSS compliant environment 5510.1. A list of security best practices .................................................................................. 5510.2. List of security measures for the mobile developer, or system administrator .................. 55

11. Load testing 5911.1. Introduction ............................................................................................................... 5911.2. Prerequisite ............................................................................................................... 5911.3. Running the load test scenario .................................................................................. 5911.4. Our results ................................................................................................................ 60

12. Appendixes 6312.1. List of WOPE configuration parameters ...................................................................... 63

12.1.1. Global parameters .......................................................................................... 6312.1.2. Per target configuration parameters ................................................................. 64

Page 5: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

v

12.2. Redirect rules for mobile phones for an Apache Web server + mod_rewrite module ....... 6712.3. Third-party libraries used by WOPE ........................................................................... 67

Page 6: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

vi

Page 7: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 1.

1

Introduction

1.1. WOPE operational diagram - Request and responsepathWOPE is a J2EE application serving finely tuned mobile content

1. Browser identification

2. Device informations transferred to the application

3. Content retrieved

4. Content adaptation according to the device capabilities

5. Resources adaptation

6. Optimized content and resources are delivered to the browser

Page 8: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

2

Page 9: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 2.

3

Installing WOPE using the GUI installer

2.1. Download the installerA GUI installer is available for Windows, Linux and MacOS development workstations.

You can download it from http://delivery.wope-framework.com/backelite/wope/.

Note

The license bundled with this installer is restricted to localhost, 127.0.0.1 and 192.x.x.x URLs : novirtualhosts are supported. You can replace it with a license obtained from Backelite in the follow-ing chapter.

2.2. Run the installerDouble click on the downloaded EXE or JAR file to run the installer.

Installing on Windows

Please make sure that there is no space character in the installation path.

Page 10: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

4

Page 11: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 3.

5

Getting Started for a server installation

3.1. Prerequisite : obtaining a licenseA license is required for WOPE to work. To obtain a license, and for any installation questions, contactWOPE support by email at [email protected] .

To generate a license, you will need the following information:

1. The MAC address of one of the network interfaces of the machine (non loopback), in the formatHH:HH:HH:HH:HH:HH.

On Linux, use the /sbin/ifconfig command and note down the HWaddr value of one of the in-terfaces.

On Windows, use the ipconfig/all command and note down the Physical Address value ofone of the interfaces.

2. The list of virtualhosts under which WOPE will serve pages (separated by commas).

localhost,mysite.com

Request for a license for a machine with the following interface: 00:50:24:91:68:42

Used for the following domains: 192.168.1.42,95.57.12.210,mysite.fr,m.mysite.fr

Backelite will send you a license file, the path to which will be needed during the WOPE installation.

3.2. Stage 1: Checking the configuration1. WOPE installation requirements

2. Assuming that "CATALINA_HOME" is the Apache Tomcat installation directory

3. Assuming that "wope-sitemobile" is the WOPE installation directory, that is, the folder where thewope-tomcat-6.0.30.war file is located;

4. The server.xml file will be located in CATALINA_HOME/conf/.

5. The file wope.ini is located in the same folder as the file wope-tomcat-6.0.30.war. Youhave a browser that can point to the server locally.

Page 12: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 3. Getting Started for a server installation

6

3.3. Stage 2: Checking the Apache Tomcat installation

Table 3.1. Verification stage: Apache Tomcat installation

Step 1 : Checkthat Apache

Tomcat is cor-rectly installed

1. Edit the server.xml file located in CATALINA_HOME/conf/.

2. Search for:

<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />

3. Check that the port is set to 8080, as shown in the example above.

4. Open the terminal

5. Type the command

cd CATALINA_HOME/bin/

and press enter.

6. If Apache Tomcat is running, you'll need to stop it with the following command:

./shutdown.sh (or shutdown.bat in Windows)

If Apache Tomcat was running, the following lines will appear onscreen:

Using CATALINA_BASE: /Users/(username)/CATALINA_HOMEUsing CATALINA_HOME: /Users/(username)/CATALINA_HOMEUsing CATALINA_TMPDIR: /Users/(username)/CATALINA_HOME/tempUsing JRE_HOME: /System/Library/Frameworks/JavaVM.framework/Versions/Curren\tJDK/HomeUsing CLASSPATH: /Users/(username)/CATALINA_HOME/bin/bootstrap.jar

Page 13: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Stage 2: Checking the Apache Tomcat installation

7

Note

If Apache Tomcat was not running, the same lines are returned followed by an error mes-sage.

7. Restart Apache Tomcat

Type the following command:

./startup.sh

(or startup.bat under Windows)

The following lines will be displayed:

Using CATALINA_BASE: /Users/(username)/CATALINA_HOMEUsing CATALINA_HOME: /Users/(username)/CATALINA_HOMEUsing CATALINA_TMPDIR: /Users/(username)/CATALINA_HOME/tempUsing JRE_HOME: /System/Library/Frameworks/JavaVM.framework/Versions/Curren\tJDK/HomeUsing CLASSPATH: /Users/(username)/CATALINA_HOME/bin/bootstrap.jar

8. Open a browser and point to the following URL: http://localhost:8080.

The Apache Tomcat welcome page will be displayed on the screen. If the Apache Tomcat page isnot displayed, please restart the installation.

9. Back in the terminal, type:

./shutdown.sh

(or startup.bat under Windows)

Page 14: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 3. Getting Started for a server installation

8

3.4. Stage 3: Creating the wope.ini file

Table 3.2. Verification stage: Copying the WOPE configuration files

Copying theWOPE con-

figuration files

Create a wope.ini file.

Open the file.

Add the license file path:

license.file.url=file:///Users/(username)/wope-sitemobile/backelite-78ca39b84200.lic

Save and exit.

3.5. Stage 4: Registering WOPE with Apache Tomcat

Table 3.3. Verification stage: Registering WOPE with Apache Tomcat

RegisteringWOPE with

Apache Tomcat

Create a ROOT.xml file in the following folder: CATALINA_HOME/conf/Catalina/localhost (cre-ate the directory structure if it does not exist).

Edit the ROOT.xml file.

Page 15: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Stage 4: Registering WOPE with Apache Tomcat

9

Copy the lines below into the file.

Specify the folder where WOPE is located.

Specify the path to the wope.ini file.

<Context docBase="/Users/(username)/wope-sitemobile/wope-tomcat-6.0.30.war"> <Environment name="wopeConfig" type="java.lang.String" override="false" value="file:///Users/(username)/wope-sitemobile/wope.ini"/></Context>

Important

Erase the contents of the folder CATALINA_HOME/work/ if it exists.

Erase the ROOT folder in $CATALINA_HOME/webapps/ if it exists.Restart Apache Tomcat

Navigate to the CATALINA_HOME/bin/ folder.

Type the following command:

./catalina.sh run

Note

In Windows type:

catalina.bat

Lines from the log will be displayed. Within the lines displayed, you should find the following lines(note that the port number located at the end of the line corresponds to the one that you entered in theserver.xml file):

INFO: Initialisation de Coyote HTTP/1.1 sur http-8080...INFO: Demarrage du service Catalina...INFO: Starting Servlet Engine: Apache Tomcat/6.0.29...INFO: Deploiement du descripteur de configuration host-manager.xml...INFO: Deploiement du descripteur de configuration manager.xml...INFO: Deploiement du descripteur de configuration ROOT.xml...INFO: Deploiement du repertoire docs de l'application web...INFO: Deploiement du repertoire examples de l'application web...INFO: Demarrage de Coyote HTTP/1.1 sur http-8080

Page 16: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 3. Getting Started for a server installation

10

...INFO: JK: ajp13 listening on /0.0.0.0:8009...INFO: Jk running ID=0 time=0/30 config=null...INFO: Jk running ID=0 time=0/30 config=null...INFO: Server startup in 11853 ms

If the preceding lines do not appear, go back to stage 1.

Open the browser and navigate to the following URL: http://localhost:8080.

The wope.mobi demo site will be displayed on screen. If the site is not displayed, go back to stage 2.

3.6. Stage 5: Check the availability of HTML pages

Table 3.4. Verification stage: Check that the Apache Tomcat and WOPE ports are open.

Check that theApache Tom-

cat and WOPEports are open.

You must have an application server installed on your server. For example, you can use EasyPHP,MAMP, Apache, etc.

The application server must be configured to listen on a particular port. As a general rule, this is setto 80 by default. It may also be assigned to the port 8888. Change to the folder where the pages arestored.

Create a file called index.php.

<?php session_start(); ?><!-- Head of page this format has to be exactly set as it is here --><html> <head> <title>WOPE: Hello World!</title> </head> <body> <p>Hello World!</p> </body>

Page 17: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Stage 6: Declaring your application server

11

</html>

Open your browser.

Note

If you query the server from another machine, replace "localhost" with the IP of the server and re-place "8888" with the port number your application server is listening on.

Browse to the following URL: http://localhost:8888/index.php

The non-interpreted code of the page should appear onscreen.

3.7. Stage 6: Declaring your application serverEdit the wope.ini file.

Only the following lines should be in this file:

license.file.url=file:///Users/(username)/wope-sitemobile/backelite-78ca39b84200.lic[default]target.protocol=httptarget.host=localhosttarget.port=8888

Note

target.host: This line should correspond to the IP address of the machine where the HTML pagesare stored.

target.port: This line specifies the port of the machine from which the HTML pages are sent.

Note

If you have to go thru an HTTP proxy in order to reach your application server, you can configurethis proxy using the JVM settings "http.proxyHost", "http.proxyPort" and "http.nonProxyHosts".WOPE will use these JVM settings to reach the application server. For example, to configure aproxy under Apache Tomcat, edit CATALINA_HOME/bin/catalina.sh and add :

export JAVA_OPTS="$JAVA_OPTS -Dhttp.proxyHost=my.proxy.hostname -Dhttp.proxyPort=my.proxy.port -Dhttp.nonProxyHosts=my.unproxified.host"

Call WOPE from the browser by navigating to the following URL: http://localhost:8080.

You will see the page created above, and you will be able to read "Hello World".

You have successfully installed WOPE.

Page 18: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 3. Getting Started for a server installation

12

Table 3.5. Verification stage: WOPE is now working correctly!

WOPE fonctionnecorrectement !

Page 19: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 4.

13

Installing WOPE on Apache Tomcat

4.1. Requirements

4.1.1. JavaYou must have a Java virtual machine in order to install Tomcat. WOPE supports JDK version 1.6 orhigher.

We strongly recommend using the Sun (now Oracle) JDK 1.6 available from Oracle1. Take care to in-stall a version matching your machine (32bit/64bit, linux/windows).

Linux

In Linux, it's preferable to use the self-extracting file (.bin) instead of the RPM file (.rpm).

Once downloaded, run the installation program and go through the wizard.

In order to use java commands in your command interpreter, you'll need to create a JAVA_HOMEenvironment variable and update your PATH variable. The JAVA_HOME variable should point tothe folder where you have installed the JDK. Add $JAVA_HOME/bin to your PATH.

You must make the installation file executable before you can run it. Use the following command:chmod +x jdk-6u21-linux-x64.bin

Windows

Once downloaded, run the installation program and go through the wizard.

Assuming that the JDK was installed in C:\Program Files\Java\jdk1.6.0_18, the configu-ration of the environment variables will be:

PATH => C:\Program Files\Java\jdk1.6.0_18\bin

CLASSPATH => C:\Program Files\Java\jdk1.6.0_18\lib\tools.jar

JAVA_HOME => C:\Program Files\Java\jdk1.6.0_18

4.1.2. Installing Tomcat 7.0.xThis is the recommended version for WOPE.

To install Tomcat, see the Tomcat 7.0.x documentation2.

1 http://www.oracle.com/technetwork/java/javase/downloads/index.html2 http://tomcat.apache.org/tomcat-7.0-doc/setup.html

Page 20: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 4. Installing WOPE on Apache Tomcat

14

Note

All installation steps below assume you have installed Tomcat using either .tar.gz or .zip binariesavailable from the download section3.

If you have installed Tomcat using a package manager instead (apt-get, yum, RPM, msi, ...)please adapt the installation paths accordingly

The environment variable CATALINA_HOME should be set to the Tomcat installation root folder.

Note

You can simply download the Tomcat distribution4 and decompress it into the rep folder of youruser account. In that case, the CATALINA_HOME variable should point to rep/apache-tom-cat-7.0.40.

Make sure that the .sh files (.bat in Windows) in the $CATALINA_HOME folder are executable.

To check that the installation was successful, run startup.sh (startup.bat in Windows)and browse to http://localhost:8080.

4.2. Installing the WOPE WebApp

Note

In these installation instructions, we will assume that the installation is made at the following loca-tions:

Linux: /usr/local/wope

Windows: c:\wope

4.2.1. Creating the configuration fileIn the WOPE installation folder, create a configuration file with an .ini extension.

Note

In this documentation, we will name the file wope.ini.

In Linux: /usr/local/wope/wope.ini

In Windows: c:\wope\wope.ini

3 http://tomcat.apache.org/download-70.cgi4 http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.40/bin/apache-tomcat-7.0.40.zip

Page 21: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

License installation

15

4.2.2. License installationThe license file, which is in binary format (.lic extension), should be copied to the target server with thenecessary permissions so that it can be read by the application server hosting WOPE .

The path to the license file must be specified in the wope.ini configuration file, using the configura-tion property license.file.url.

Note

You can copy the file found in the WOPE installation folder.

In Linux:

Edit /usr/local/wope/wope.ini:

license.file.url=file:///usr/local/wope/backelite-licence.lic

In Windows:

Edit c:\wope\wope.ini:

license.file.url=file:///c:/wope/backelite-licence.lic

4.2.3. Installing WOPEThe file wope-6.0.30.war provided by Backelite must be installed on the Tomcat server.

The configuration listed below can be used on both versions of Tomcat supported by WOPE.

Note

You can copy the file in the wope folder.

In Linux: /usr/local/wope/wope-6.0.30.war

In Windows: c:\wope\wope-6.0.30.war

4.2.3.1. Creating a Tomcat context for WOPE

Note

To create a context under Tomcat, you'll need to create a context file under $CATALINA_HOME/conf/Catalina/localhost, where $CATALINA_HOME is the Tomcat installation folder.

The file must have an .xml extension, and the name of the file will be the name of the contextlinked to WOPE. For example, if the file is named wope.xml, the URL associated with WOPE willbe http://localhost:8080/wope.

Page 22: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 4. Installing WOPE on Apache Tomcat

16

Here we will use a ROOT.xml context, which will associate WOPE with the root of the server. TheURL associated with WOPE will then be: http://localhost:8080.

In Linux, create the file: $CATALINA_HOME/conf/Catalina/localhost/ROOT.xml

In Windows, create the file: %CATALINA_HOME%\conf\Catalina\localhost\ROOT.xml

The ROOT.xml file must contain the following information:

1. The context configuration must point to the file wope-6.0.30.war.

<Context docBase="/usr/local/wope/wope-6.0.30.war"/>

2. Declare the environment variable wopeConfig so that your context points to WOPE configurationfile

a. Either by adding into Context tag the element Environment without forgetting theoverride="false" attribute to avoid the value of this environment variable being overrid-den by another of the same name defined within the web.xml file.

In Linux, edit the file $CATALINA_HOME/conf/Catalina/localhost/ROOT.xml:

<Context docBase="/usr/local/wope/wope-6.0.30.war"> <Environment name="wopeConfig" type="java.lang.String" value="file:///usr/local/wope/wope.ini" override="false"/></Context>

In Windows, edit the file %CATALINA_HOME%\conf\Catalina\localhost\ROOT.xml:

<Context docBase="c:/wope/wope-6.0.30.war"> <Environment name="wopeConfig" type="java.lang.String" value="file:///c:/wope/wope.ini" override="false"/></Context>

b. Either by transmitting this environment variable to the JVM at Tomcat startup

In Windows, if it does not exist, create file setenv.bat into directory $CATALINA_HOME/bin/, then edit it to add the following line :

JAVA_OPTS="$JAVA_OPTS -DwopeConfig=c:/wope/wope.ini"

In Linux, if it does not exist, create file setenv.sh into directory $CATALINA_HOME/bin/,then edit it to add the following line :

JAVA_OPTS="$JAVA_OPTS -DwopeConfig=/usr/local/wope/wope.ini"

Warning

If you are restarting a WOPE installation from the beginning, or are upgrading WOPE, you mustclean up the contents of the work folder ($CATALINA_HOME/work/). Under Apache Tomcat 6.x,you must also erase the ROOT folder inside the $CATALINA_HOME/webapps/ folder.

Page 23: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Configuring the server's UTF-8 encoding

17

4.2.4. Configuring the server's UTF-8 encoding

Warning

The application server must be configured to receive HTTP requests with UTF-8 encoding. Other-wise, characters such as accents will be improperly interpreted by WOPE .

Add the URIEncoding="UTF-8" attribute to the <Connector/> tag of the file CATALINA_HOME/conf/server.xml:

<Connector port="8009" protocol="AJP/1.3" URIEncoding="UTF-8"/>

4.2.5. Configure the server for WebP image generationWOPE can generate WebP images for clients using the Google Chrome browser or Android 4.x stockbrowsers. WebP images can provide a weight reduction between 30% - 70% of the original JPEG orPNG image.

This feature is disabled by default for retro compatibility reasons. To enable this feature, youneed to set the following property in your .ini file :

webPenabled=true

Warning

WebP image generation is currently only supported for Linux servers with x64 CPU architecture.

A shared library must be installed on your linux server to generateWebP images

Copy the shared library libwebp_jni.so from the WEB-INF/native directory of the unpackedWOPE archive to a /path/to/your/shared/libraries directory on your server, for exam-ple : /opt/wope/lib or /path/to/tomcat/lib.

You must then point the java.library.path JVM variable to the shared libraries folder defined above.

In Linux, if it does not exist, create file setenv.sh into directory $CATALINA_HOME/bin/, then edit itto add the following line :

JAVA_OPTS="$JAVA_OPTS -DwopeConfig=/usr/local/wope/wope.ini -Djava.library.path=/path/to/your/shared/libraries"

4.3. Verifying the installationPoint your browser to: http://localhost:8080/5. You should see the following page:

5 http://localhost:8080

Page 24: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 4. Installing WOPE on Apache Tomcat

18

4.4. Session replicationWOPE is JEE compliant for session management. To configure the session replication, see the officialdocumentation6.

6 http://tomcat.apache.org/tomcat-6.0-doc/config/manager.html

Page 25: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 5.

19

Installing WOPE with IBM WebsphereApplication Server

5.1. Requirements

5.1.1. Application serverWOPE supports IBM Websphere Application Server 7. To install the latter, see the WebSphere docu-mentation1.

5.2. Installing the WOPE WebApp

Note

In these installation instructions, we will assume that the installation will be made at the followinglocation:

In Linux: /usr/local/wope

Windows: c:\wope

5.2.1. Creating the configuration fileIn the WOPE installation folder, create a configuration file with an .ini extension.

Note

In this documentation, we will call the file wope.ini.

In Linux: /usr/local/wope/wope.ini

In Windows: c:\wope\wope.ini

5.2.2. License installationThe license file, which is in binary format (.lic extension), should be copied to the target server with thenecessary permissions so that it can be read by the application server hosting WOPE .

The path to the license file must be specified in the wope.ini configuration file, using the configura-tion property license.file.url.

1 http://www-01.ibm.com/software/websphere/

Page 26: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 5. Installing WOPE with IBM Websphere Application Server

20

Note

You can copy the file found in the WOPE installation folder.

In Linux:

Edit /usr/local/wope/wope.ini:

license.file.url=file:///usr/local/wope/backelite-licence.lic

In Windows:

Edit c:\wope\wope.ini:

license.file.url=file:///c:/wope/backelite-licence.lic

5.2.3. Installing WOPEIn the Websphere control panel:

1. Deploy the file wope-6.0.30.war.

a. Under the Applications tab, click on New application.

b. Choose New business application as the application type, and click on Next.

c. Specify the location of the file wope-6.0.30.war as the full access path, and click on Next.

d. On the next page, check the default option Shortcut and click on Next.

e. Uncheck the box Create MBeans beans for the resources and click on Next.

f. On the page Mapping modules to servers, click on Next.

g. Keep the suggested default virtual host and click on Next

h. Specify "/" as the context root.

i. Click on Finish , then Save.

2. Configure WOPE .

a. Return to the Applications tab and click on WebSphere enterprise applications.

b. Display the configuration page of the WOPE module, as shown below, by selecting the WOPEweb app from the list of applications.

Page 27: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Installing WOPE

21

c. Enter the path for the WOPE configuration file.

i. Still on the configuration page, in the section Web module properties click on Envi-ronment settings for the Web modules.

ii. Enter the path of the wope.ini file in the Value field, as shown in the screenshot below.

Note

In Linux: file:///usr/local/wope/wope.ini

In Windows: file:///c:/wope/wope.ini

iii. Click on Save.

Page 28: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 5. Installing WOPE with IBM Websphere Application Server

22

3. Stop the default application.

This step is necessary in order to associate WOPE with the root of the server. WOPE can then beaccessed with the address http://localhost:9080

a. Return to the Applications tab and click on WebSphere enterprise applications.

b. Select Default Application and then click on Stop.

4. Start the WOPE application.

a. Return to the Applications tab and click on WebSphere enterprise applications.

b. Select the WOPE application and click on Start. The application will be available at the ad-dress http://localhost:9080.

5.2.4. Configuring the server's UTF-8 encoding

Warning

The application server must be configured to receive HTTP requests with UTF-8 encoding. Other-wise, characters such as accents will be improperly interpreted by WOPE .

1. In the admin control panel, click on Servers > Application servers and then select theserver to be activated for the UCS format.

2. Then, under Server infrastructure, click on Process management and Java > Defineprocesses > Java virtual machine.

3. Specify

-Dclient.encoding.override=UTF-8

in the Generic JVM Arguments area, and click OK.

4. Click Save to save your changes.

5. Restart the application server.

Note

Procedures taken from the original IBM documentation2.

2 http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/trun_svr_utf.html

Page 29: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Configure the server for WebP image generation

23

5.2.5. Configure the server for WebP image generationWOPE can generate WebP images for clients using the Google Chrome browser or Android 4.x stockbrowsers. WebP images can provide a weight reduction between 30% - 70% of the original JPEG orPNG image.

This feature is disabled by default for retro compatibility reasons. To enable this feature, youneed to set the following property in your .ini file :

webPenabled=true

Warning

WebP image generation is currently only supported for Linux servers with x64 CPU architecture.

A shared library must be installed on your linux server to generateWebP images

Copy the shared library libwebp_jni.so from the WEB-INF/native directory of the unpackedWOPE archive to a /path/to/your/shared/libraries directory.

You must then point the java.library.path JVM variable to the shared libraries folder defined above.

1. In the admin control panel, click on Servers > Application servers and then select theserver to be activated for the UCS format.

2. Then, under Server infrastructure, click on Process management and Java > Defineprocesses > Java virtual machine.

3. Specify

-Dclient.encoding.override=UTF-8 -Djava.library.path=/path/to/your/shared/libraries

in the Generic JVM Arguments area, and click OK.

4. Click Save to save your changes.

5. Restart the application server.

Note

Procedures taken from the original IBM documentation3.

3 http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/trun_svr_utf.html

Page 30: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 5. Installing WOPE with IBM Websphere Application Server

24

5.3. Verifying the installationPoint your browser to: http://localhost:8080/4. You should see the following page:

4 http://localhost:8080

Page 31: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 6.

25

Installing WOPE with JBOSS WildflyApplication Server

6.1. Requirements

6.1.1. Application serverWOPE supports JBOSS Wildfly 8.2.0 Application Server. To install the latter, see the JBOSS docu-mentation1.

Note

We will assume that you created a user with management privileges, the JBOSS_HOME en-vironment variable is correctly set and the JBOSS console web application is accessible athttp://127.0.0.1:99902 after running:

In Linux: $JBOSS_HOME/bin/./standalone.sh

Windows: %JBOSS_HOME%\bin\standalone.bat

6.2. Installing the WOPE WebApp

Note

In these installation instructions, we will assume that the installation will be made at the followinglocation:

In Linux: /usr/local/wope

Windows: c:\wope

6.2.1. Creating the configuration fileIn the WOPE installation folder, create a configuration file with an .ini extension.

Note

In this documentation, we will call the file wope.ini.

In Linux: /usr/local/wope/wope.ini

In Windows: c:\wope\wope.ini

1 https://docs.jboss.org/author/display/WFLY8/Documentation2 http://127.0.0.1:9990/

Page 32: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 6. Installing WOPE with JBOSS Wildfly Application Server

26

6.2.2. License installationThe license file, which is in binary format (.lic extension), should be copied to the target server with thenecessary permissions so that it can be read by the application server hosting WOPE .

The path to the license file must be specified in the wope.ini configuration file, using the configura-tion property license.file.url.

Note

You can copy the file found in the WOPE installation folder.

In Linux:

Edit /usr/local/wope/wope.ini:

license.file.url=file:///usr/local/wope/backelite-licence.lic

In Windows:

Edit c:\wope\wope.ini:

license.file.url=file:///c:/wope/backelite-licence.lic

6.2.3. Prepare JBOSS for WOPEFind the xml file $JBOSS_HOME/standalone/configuration/standalone.xml

1. Specify the configuration file

After the extensions block tag

<extensions> <extension module="..."/> [...]</extensions>

add the following lines:

<system-properties> <property name="wopeConfig" value="path_to_wope.ini"/></system-properties>

2. Listen to all interfaces

This step is usefull if you want to work with non local addresses. Look for the interfaces block tag:

<interfaces>

Page 33: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Configuring the server's UTF-8 encoding

27

<interface name="management"> <inet-address value="${jboss.bind.address.management:127.0.0.1}"/> </interface> [...]</interfaces>

and within this tag, add a the end:

<interface name="any"> <any-address/></interface>

3. Specify wope-6.0.30.war as the default application

This step is necessary in order to associate WOPE with the root of the server. WOPE can then beaccessed with the address http://localhost:8080

Put the archive wope-6.0.30.war in the folder $JBOSS_HOME/standalone/deploymentsbut rename it to ROOT.war

6.2.4. Configuring the server's UTF-8 encoding

Warning

The application server must be configured to receive HTTP requests with UTF-8 encoding. Other-wise, characters such as accents will be improperly interpreted by WOPE .

Locate the file $JBOSS_HOME/bin/standalone.conf. At the end of this file, add:

JAVA_OPTS="$JAVA_OPTS -Dclient.encoding.override=UTF-8"

6.2.5. Configure the server for WebP image generationWOPE can generate WebP images for clients using the Google Chrome browser or Android 4.x stockbrowsers. WebP images can provide a weight reduction between 30% - 70% of the original JPEG orPNG image.

This feature is disabled by default for retro compatibility reasons. To enable this feature, youneed to set the following property in your .ini file :

webPenabled=true

Warning

WebP image generation is currently only supported for Linux servers with x64 CPU architecture.

Page 34: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 6. Installing WOPE with JBOSS Wildfly Application Server

28

A shared library must be installed on your linux server to generateWebP images

Copy the shared library libwebp_jni.so from the WEB-INF/native directory of the unpackedWOPE archive to a path_to_your_shared_libraries directory.

You must then point the java.library.path JVM variable to the shared libraries folder defined above.

Locate the file $JBOSS_HOME/bin/standalone.conf. At the end of this file, add:

JAVA_OPTS="$JAVA_OPTS -Djava.library.path=path_to_your_shared_libraries"

6.3. Verifying the installation1. Start the WOPE application:

In Linux: $JBOSS_HOME/bin/./standalone.sh

Windows: %JBOSS_HOME%\bin\standalone.bat

2. Point your browser to: http://localhost:8080/3.

The default page configured in WOPE is the same one shown on the demo site hosted with Back-elite. You should see the following page:

3 http://localhost:8080

Page 35: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Verifying the installation

29

Page 36: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

30

Page 37: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 7.

31

Configuring WOPENote

The configuration file can be named anything your like. For convenience, in this document we willassume the file is named wope.ini.

7.1. Configuring a target siteThe configuration settings for a target site should be added to the wope.ini configuration file.

1.Example 7.1. Sample wope.ini configuration file

license.file.url=file:///myLicenseFile.lic

[default]target.protocol=httptarget.host=bkml.wope.mobitarget.port=80

Warning

The parameter license.file.url must be declared at the top of the file.

Table 7.1. Configuring the target service

license.file.url Path of the WOPE license file

target.host Address of the server hosting the HTML appli-cation (e.g.: html.mysite.com)

target.port Port of the server hosting the HTML application(e.g.: 80)

target.contextPath Empty, or containing the path followingtarget.host (e.g.: if the target.contextPath at-tribute is defined, all of the traffic requestedby WOPE to the target will be served at http://target.host(target.port)/target.contextPath).Note: See also Using the target.remap attributein association with target.contextPath.

Reminder : Properties are defined in the following format: property_name=property_value

Page 38: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 7. Configuring WOPE

32

Note

If configuring several different target sites in the same configuration file, see Section 7.3.2,“Configuring several different mobile sites using the same WOPE instance (multi-site configu-ration)”

Warning

Restart the server for the modifications to take effect.

7.2. Displaying errors

7.2.1. Displaying errors in development modeBy default, WOPE displays a standard error page (see Section 7.2.3.2, “Error pages”) when there is aproblem with the application server.

In development mode, this behavior is not well suited to verifying whether, for example, a syntax erroris present in the target HTML language. So to see the error details:

1. Edit the wope.ini configuration file.

2. Add the line:

target.debug=true

3. Restart Tomcat.

Note

When using WOPE in multi-site mode, this property can be set for each site in the respective sec-tions of the wope.ini configuration file. See Section 7.3.2, “Configuring several different mobilesites using the same WOPE instance (multi-site configuration)”.

7.2.2. Displaying Javascript logsBy default, Javascript log level is set to error.

In development mode, it is recommended to set Javascript log level to a more verbose level.

Edit the wope.ini configuration file and add the following line. You must restart Tomcat so thatchanges take effect.

target.js.logLevel=debug

Page 39: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Displaying errors in production mode

33

Note

When using WOPE in multi-site mode, this property can be set for each site in the respective sec-tions of the wope.ini configuration file. See Section 7.3.2, “Configuring several different mobilesites using the same WOPE instance (multi-site configuration)”.

7.2.3. Displaying errors in production mode

7.2.3.1. Receiving HTML errors by emailIn production mode, it is strongly discouraged to let WOPE display parsing rrors to the user (see Sec-tion 7.2.1, “Displaying errors in development mode”). Alternatively, WOPE can send any errors viaemail. Here's how:

1. Edit the wope.ini configuration file.

2. Add the following properties:

Table 7.2. Configuring WOPE to send HTML error messages via email

Property Value

pipelineerrors.sendEmail true

pipelineerrors.bkmlBufferingEnabled true

pipelineerrors.logPipelineErrors true

pipelineerrors.smtphost The address of the smtp server to be used tosend the emails (e.g.: smtp.mysite.com)

pipelineerrors.emailFrom Sender (e.g.: [email protected])

pipelineerrors.emailTo Recipient (e.g.: [email protected])

pipelineerrors.emailSubject Sujet du mail (ex : “[WOPE ] Rapport d'erreur -{URL}” )

3. Restart Tomcat.

7.2.3.2. Error pages

7.2.3.2.1. How error pages workIn the event the application server is unavailable, or when any other type of error is encountered,WOPE sends an error page to the device.

WOPE displays two different error pages, depending on the following scenarios:

• In the event of a server-side wope application error, WOPE intercepts the HTTP code (500, 404,403 and 400).

• In the event the HTML application is unavailable, the server is not responding, or the connectiontimeout has expired.

The error pages are written in HTML and are customizable in order to match the site's design.

Page 40: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 7. Configuring WOPE

34

7.2.3.2.2. Configuring error pages1. Error page templates are available at http://delivery.wope-framework.com/backelite/wope/latest1.

Download the file wope-errors-6.0.30.zip.

This archive has the error page templates.

2. Edit the wope.ini configuration file.

Add the target.errorBundle property and set it to the path of the above mentioned archive.

target.debug=false target.errorBundle=file:///etc/wope/error_pages/wope-errors-[wopeversion].zip

Note

The target.errorBundle property can be configured for each section. Therefore, in amulti-site configuration, it's possible to have different error pages for each site (see: Sec-tion 7.3.2, “Configuring several different mobile sites using the same WOPE instance (mul-ti-site configuration)”).

Note

The target.errorBundle property can either contain the path of the zip file itself or thepath of a folder with the contents of the zip archive.

Warning

To display the error pages, ensure that the display of detailed error messages is disabled inthe WOPE configuration file, by setting target.debug=false.

3. Restart Tomcat.

7.2.3.2.3. Customizing error pagesDetailed content of the wope-errors-[wopeversion].zip archive:

• img folder: contains the graphical elements.

• bkresources.tmpl: this file should not be modified.

• error_4xx.html: HTML page displayed in the event of a 4XX error.

• error_5xx.html: HTML page displayed in the event of an internal WOPE error or timeout duringan Ajax navigation.

1 http://delivery.wope-framework.com/backelite/wope/latest/

Page 41: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

WOPE options related to your mobile site

35

The error_4xx.html and error_5xx.html pages are written in HTML. The HTML language isdescribed in the Developer Guide and HTML Language Guide.

Example 7.2. Page error_4xx.html

#parse('bkresources.tmpl')<?xml version="1.0" encoding="UTF-8"?><hml> <head> <title>Error page 4xx</title> </head> <body> <div> this is the default bundled 4xx error page<br/> <img src="#bkresource('/img/picto-phone-orange.png')" alt=""/> </div> </body></html>

Points to consider:

• The line #parse('bkresources.tmpl') should not be edited or deleted.

• To refer to an image, use the macro #bkresource('/img/myImage.png'). The path of the im-age is relative to the error page.

• The file names: error_4xx.html and error_5xx.html must not be changed.

Note

In development, creation of the error pages is easier if the target.errorBundle propertypoints to a folder containing the contents of the zip archive. In production, it's advisable to recom-press the files into a zip archive and point the property to that.

Note

In order to allow the user to continue navigating the site in the event of an error, error messagesshould contain a return link to the site.

7.3. WOPE options related to your mobile site

7.3.1. Redirecting a non-mobile device to another siteWOPE can redirect a device that is detected as being a PC to another site (for example, the sitewww.mysite.com targeted at PCs).

In the configuration file wope.ini, set the target.redirect.website.url property to an absolute URL.This URL may also contain the following parameter: orig=%u. %u will be replaced by the encodedsource URL before the user is redirected.

Usage example: PC browsers should be redirected to www.mysite.com with the orig request para-meter containing the URL which called WOPE :

Page 42: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 7. Configuring WOPE

36

target.redirect.website.url=http://www.monsite.com?orig=%u

PC browsers visiting http://wope/index.php2 will automatically be redirected to http://www.monsite.com?orig=http%3A%2F%2Fwope%2Findex.php3.

7.3.2. Configuring several different mobile sites using the sameWOPE instance (multi-site configuration)

7.3.2.1. PrinciplesWOPE can target different business applications based on the name of the host where a request willbe executed.

In the following example, the subdomains http://mysite-a.service.fr and http://mysite-b.service.fr dis-play two different mobile sites using the same WOPE installation.

• A request to http://mysite-a.service.fr triggers a call to http://a.service.fr.

• A request to http://monsite-b.service.fr4 triggers a call to http://b.service.fr5.

Multi-site configuration is based on sections in the wope.ini configuration file.

7.3.2.2. ConfigurationTo configure the above-mentioned example:

1. Edit the wope.ini configuration file.

2. Create a section for each site, plus a [default] section.

One section would be called [mysite-b.service.fr], which is the name of the site's domain (withoutthe http://).

All of the properties that are unique to each site are defined in their respective section.

Example 7.3. Multi-site configuration for 2 sites each with their own set of error pages

license.file.url=file:///myLicensingFile.lic

[default]target.protocol=httptarget.host=wope.mobitarget.port=80

[monsite-a.service.fr]target.host=a.service.frtarget.debug=falsetarget.errorBundle=file:///etc/wope/error_pages/a-errors-pages.zip

[monsite-b.service.fr]target.host=b.service.fr

2 http://bkrender/index.php3 http://mon.site.web?orig=http%3A%2F%2Fwope%2Findex.php4 http://mysite-b.service.fr5 http://mysite-b.service.fr

Page 43: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Configuring data exchange between the mobile device, WOPE and the business application

37

target.debug=falsetarget.errorBundle=file:///etc/wope/error_pages/b-errors-pages.zip

Note

Inheritance: Each section takes the values of properties not defined within that section fromthe [default] section.

3. Restart Tomcat.

7.4. Configuring data exchange between the mobile device,WOPE and the business application

7.4.1. Sending information about a device's features

7.4.1.1. ConfigurationInformation regarding a device's features or capabilities is sent to the business application via HTTPheaders, in the format X-Bk-Capacity-feature_name=feature_value. By default, WOPE doesnot send all of the available feature information for a device in order to avoid sending unneeded head-ers to the business application.

To configure which information will be sent to the business application:

• Edit the wope.ini configuration file.

• Add:

target.wurflCapacities=feature_name,feature_name

Note

The feature names should be comma-separated, without spaces.

• Restart Tomcat.

7.4.1.2. List of device featuresPlease refer to the Developer handbook, Appendix I.

7.4.2. User identification

7.4.2.1. X-Bk-AliasTo uniquely identify each user, we recommend using the X-Bk-Alias header.

Page 44: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 7. Configuring WOPE

38

Example: This can be used to record the user's address information in order to avoid the user havingto enter it more than once in a form.

The X-Bk-Alias header is a unique visitor identifier made up of the name of the operator + "-" + theuser ID.

Possible operator values: SFR, Orange, ByTel, Unknown

7.4.2.2. CookiesFor privacy reasons, the business application may not be authorized to store data linked to the user(for example, a bank account number or a medical record number). In that case, WOPE may be con-figured to instruct the business application to send a personalized cookie to the client browser, in orderto store the information client-side rather than server-side.

• Edit the wope.ini configuration file.

• To send the browser the cookies "cookie_name_1", "cookie_name_2" created by the application,add the following line:

target.allowedCookies=cookie_name_1,cookie_name_2

To send the browser all the cookies created by the application (no filtering here, unlike previously),add the following line:

target.allowedCookies=*

• The cookie will be sent to the application as a standard cookie, via a Cookie:cookie_name=value header.

The cookie domain is left to the default value i.e. the domain for which WOPE is handling the re-quest. Generally it will be the current domain shown in the URL bar of the browser. You can changethe cookie domain by using the target.proxyPassReverseCookieDomain. Example:

target.proxyPassReverseCookieDomain=internal-domain public-domain

In this example, for cookies with domain internal-domain, WOPE will set the domain to pub-lic-domain.

All cookies other than the cookie_name cookie previously defined are internally created byWOPE . WOPE handles the sending of the cookies to the business application, and does not sendthem to the client by default; rather, they are stored in the client session managed by WOPE . Thisallows phones which do not support cookies to benefit from a cookie-type mechanism by includingthe session in the URLs.

The diagram below describes the exchange of cookies.

Page 45: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Configuring WOPE with a load-balancer

39

Figure 7.1. Exchange of cookies

7.4.3. Configuring WOPE with a load-balancer

7.4.3.1. Detecting the device addressWhen WOPE is behind a load-balancer, it is advisable to set the extract-forwarded-for option to true.This allows WOPE to determine the IP address of the device based on the content of the X-For-warded-For HTTP header.

7.4.3.2. Secure connectionThe X-Bk-Secure-Request header is sent by default when a connection to WOPE is made overHTTPS. But if WOPE is behind a load-balancer, it's possible that the latter may not pass on theHTTPS connection to WOPE . In that case, the load-balancer, if needed, can be configured to pass aHTTP header telling WOPE that a HTTPS connection is being made between the load-balancer andthe client.

• Edit the wope.ini configuration file.

• Add the line:

target.secureLbHeader=header_name

• Once the header header_name with a value of "true" is sent to WOPE , then the X-Bk-Se-cure-Request header will also be set to "true"

7.4.4. Managing the browser cache with WOPEWOPE forwards a number of HTTP cache headers in its exchanges with the HTML5 application. Theobjective is to let the cache be defined at the application level, including whether content should be re-freshed (e.g.: passing a Cache-Control header), or whether to send a Conditional GET (e.g.: allow a304 Not Modified code to be sent to the client).

Cache headers are exchanged between the client (mobile device) and the server (WOPE).

Page 46: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 7. Configuring WOPE

40

• List of HTTP headers authorized to be sent from the client to the server:

All

• List of HTTP headers authorized to be sent from the server to the client:

All but Transfer-Encoding

7.4.5. HTTPS configuration between WOPE and the HTML applica-tion• Configure the connection in HTTPS.

Open the configuration file of the business application and modify the protocol and port to use a se-cure HTTPS connection

target.protocol=httpstarget.port=443

Note

Important note: By default, WOPE will not establish a HTTPS connection with a business appli-cation that uses a self-signed certificate. This behavior may be modified, if, for example, in thedevelopment environment a self-signed certificate is used by a developer of the business appli-cation. In that case, add the following property: target.selfsigned=true.

Warning

The target.selfsigned=true property should never be used in production!

Page 47: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

HTTPS configuration between WOPE and the HTML application

41

Note

Perform the following steps to add an SSL certificate (whether self-signed or not) inthe JVM so that it is recognized by WOPE . (This is only necessary if the exceptionsun.security.provider.certpath.SunCertPathBuilderException: unable tofind valid certification path to requested target appears in the logs.)

• Point the browser to an HTTPS URL using this certificate.

• Save the HTTPS certificate in a file. (Example using Firefox: click the icon to the left of thelink in the address bar, More Information -> Security Tab -> View Certifi-cate -> Details -> Export)

• Open a terminal and type the following command: keytool -import -filecertificate_file_saved -trustcacerts -keystore $JAVA_HOME/jre/lib/security/cacerts -alias my_certificate

• Check that the certificate was correctly added by using the following the command: key-tool -list -keystore $JAVA_HOME/jre/lib/security/cacerts -aliasmy_certificate

• Configure two-way authentication

Two-way authentication allows WOPE to identify itself to the server it wishes to contact using aclient certificate.

To activate two-way authentication between WOPE and a business application, edit the configura-tion file wope.ini:

target.mutualAuthRequired=truetarget.client.keyStore=full path of the keystore containing the client certificatetarget.client.trustStore=full path of the truststore containing the server certificatetarget.client.keyStore.password=keystore passwordtarget.client.trustStore.password=truststore password

Note

The keystore should be in JKS format. If the client certificate was generated in PKCS12 format(e.g., by OpenSSL), it must be exported to JKS format.

• Download http://juliusdavies.ca/commons-ssl/not-yet-commons-ssl-0.3.10.jar

• Export the PKCS12 certificate to JKS with the following command: java -cp not-yet-commons-ssl-0.3.10.jar org.apache.commons.ssl.KeyStoreBuilder pass-word certificate_name.p12

• Enable a list of allowed ciphers

For increased security, set the property target.enabledCipherSuites to a restricted list of ciphers(comma-separated) to be used for secure connections, with or without two-way authentication.

Page 48: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 7. Configuring WOPE

42

Example 7.4. Enable a list of ciphers to be used

target.enabledCipherSuites=SSL_RSA_WITH_RC4_128_SHA,TLS_RSA_WITH_AES_128_CBC_SHA

A list of possible ciphers is available in the table "Cipher Suite" of Java documentation6.

Note

To use AES-256 ciphers, the package "Java Cryptography Extension (JCE) Unlimited StrengthJurisdiction Policy" must be installed. This package can be found at the bottom of the pagehttp://java.sun.com/javase/downloads/index.jsp.

7.4.6. Disable the processing of certain pages by the WOPE engineAs of version 5.0 and higher of WOPE , it is now possible to disable the processing of certain pages bythe WOPE engine by sending an HTTP header X-Bk-Engine with a value of "off".

Ajax transitions have to be disabled if page processing is disabled

Since you are disabling the processing of a page by WOPE, you will need to disable Ajax transi-tions for all links leading to the unprocessed page by using the data-bk-ajax attribute with avalue set to "false"

Example 7.5. data-bk-ajax attribute

<a href="my_unprocessed_page.php" data-bk-ajax="false"> My link to the unprocessed page</a>

7.5. Domain alias settingsA domain alias is alternate name for an Internet domain. For instance, if the http://monsite-a.fr domainis an alias of the http://monsite.fr domain, a request to http://monsite-a.fr or http://monsite.fr will displaythe same website.

To set an alias for http://monsite-a.fr for the http://monsite.fr domain:

1. Edit the wope.ini configuration file.

2. Add the following line to the [monsite-a.fr] section:

alias=monsite-a.fr

6 http://java.sun.com/j2se/1.5.0/docs/guide/security/jsse/JSSERefGuide.html#AppA

Page 49: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Audience measurement

43

Note

The alias property can be set only in a section.

It is also possible to set multiple aliases for a given website in the mysite.com7 section

[mysite.com]target.protocol=httptarget.host=mysite.mobitarget.port=80alias=mysite-a.com, mysite-b.com, mysite-c.com

Note

The alias list must be colon separated.

3. Restart Tomcat.

7.6. Audience measurementWOPE lets you tag automatically your mobile site to get audience reporting in third party tools such asAtInternet or Google Analytics.

7.6.1. Configure audience measurement for AT InternetPrerequisite: get the site ID and the server URL provided by AT Internet8.

1. Edit the wope.ini configuration file.

2. Add the site ID and the server URL:

target.atInternetSiteId=My_site_id target.atInternetServerUrl=http://logiXXX.xiti.com/hit.xiti

3. Also add the atInternetSecureServerUrl property to your configuration file if https is used:

target.atInternetSecureServerUrl=https://logXXXX.xiti.com/hit.xiti

4. Restart Tomcat.

7 #8 http://www.atinternet.com/

Page 50: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 7. Configuring WOPE

44

7.6.2. Configure audience measurement for Google AnalyticsPrerequisite: get the Google Analytics account ID provided by Google Analytics9.

1. Edit the wope.ini configuration file.

2. Add the Google Analytics account ID:

target.googleAnalyticsAccountId=MO-12345678-9

Warning

Because this is a mobile dedicated Web site, change the prefix on your Google Analytics ac-count ID from UA- to MO-. For example, if your Google Analytics account ID is UA-12345-67,you would use MO-12345-67.

3. Restart Tomcat.

9 http://www.google.com/analytics/

Page 51: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 8.

45

Operating WOPE

8.1. Activating JMX (Java Management Extensions)Certain features require the activation of JMX calls (Java Management Extensions) on the Tomcatserver used by WOPE. Following are the steps to activate JMX:

Note

The procedure only works on Tomcat version 5.5.23 or 6.0.16 or higher, due to a bug1 in theTomcat startup script.

1. 1. Create or edit the file $CATALINA_HOME/bin/setenv.sh (Linux) or #CATALINA_HOME#/bin/setenv.bat (Windows).

2. Define the JMX configuration in the CATALINA_OPTS variable by replacing JMX_PORT with thevalue of the desired port:

export CATALINA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=JMX_PORT-Dcom.sun.management.jmxremote.ssl=false-Dcom.sun.management.jmxremote.authenticate=false"

3. Restart Tomcat

Warning

This configuration allows unauthenticated JMX calls. Authentication can be enabled by followingthe instructions in "Enabling JMX remote" found at:

Tomcat 5.5 http://tomcat.apache.org/tomcat-5.5-doc/monitoring.html

Tomcat 6.0 http://tomcat.apache.org/tomcat-6.0-doc/monitoring.html

8.2. Caching images with WOPEFor performance reasons, all images of the mobile site (whether resized or not) are cached in memory(ehcache) by WOPE . This reduces the number of requests between WOPE . and the mobile applica-tion and reuses the images already resized and cached.

Each image is passed through the "/bkimages"2 WOPE image filter.

Incoming HTML code: <img src="/img/photo.jpg" alt="Diaporama" />

Outgoing HTML code: <img src="/bkimages/img/photo.jpg/resized_width_in_pixels/resized_height_in_pixels/JPEG" alt="Diaporama" />

1 https://issues.apache.org/bugzilla/show_bug.cgi?id=369762 /bkimages

Page 52: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 8. Operating WOPE

46

Note

Certain images (used directly in CSS) are not passed through the filter.The image cache retention is governed by the following criteria:

• Maximum number of images which can be stored in memory before the cache is written to disk:10000.

• Overflow in the Tomcat temp folder is permitted.

• Maximum retention time: 2 hours.

• Time since last use before deletion: 1 hour.

The cache keys are stored in memory only and are not persistent (and therefore not reused after thenext WOPE restart).

The cache is not currently configured to be shared between different WOPE instances.

The Ehcache instance can be queried via JMX:

Go to the "MBeans" tab -> "com.backelite" -> "ImageResourceCacheManager" -> "Operations"

• RemoveAll(): deletes the cache data

• GetKeys(): displays the cache data

8.3. Forcing a rewrite of virtual foldersIf a HTML document generated by a target references resources using absolute paths (for example, "/img/logo.png"3), but WOPE should not call these using the target.contextPath attribute, then these callexceptions must be explicitly declared using the target.remap attribute.

For example, if the HTML target is hosted at http://mysite/dossier/, and WOPE is configured withtarget.contextPath=dossier/, and in HTML a resource is referenced via "/img/logo.png"4, then bydefault WOPE will try to call the resource at http://target.host(target.port)/target.contextPath/img/logo.png, which in this example would translate as http://mysite/dossier/img/logo.png.

If this is not the desired behavior (for example, if /img on the target is actually served at http://target.host(target.port)/img), then this must be explicitly declared using target.remap=/img=/img. (Thesyntax used is target.remap=html path of the resource=true server path of the resource.) This will tellWOPE to call the resource using http://target.host(target.port)/img/logo.png.

8.4. Logging installation

8.4.1. Analyzing the application logsAll of the logs written by WOPE have the following prefix: [BK-(TEXT or FOUR_DIGITS)]. This prefixcan be used to drill down to specific entries in the logs. This code is not an indicator of the log's ver-bosity level—that is indicated by the prefix DEBUG, INFO, WARN, ERROR or FATAL.

3 /img/logo.png4 /img/logo.png

Page 53: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Analyzing the application logs

47

Table 8.1. Values of BK constants

Code Description

[BK-ERROR] Generic error

[BK-CONFERROR] Configuration error

[BK-SHUTDOWN] The WOPE application is shutting down (e.g.: re-deployment)

[BK-STARTUP] The WOPE application is starting up (e.g.: de-ployment)

[BK-OPERATION] Operation in progress. A series of operations isperformed for each request made to the busi-ness application.

[BK-GET] HTTP GET request made

[BK-POST] HTTP POST request made

[BK-REDIRECT] Redirect requested by the business application.For example, transmission of HTTP code 301,302 or 303. See notes.

[BK-HEADER] HTTP headers sent by WOPE and by the busi-ness application

[BK-COOKIE] Cookies sent by WOPE and by the business ap-plication

[BK-USERAGENT] Operations performed on the User-Agent header

[BK-CSS] Operations performed on Cascading StyleSheets

[BK-CUSTOM] Operation performed on WOPE local resources;for example, loading local error pages

[BK-CRYPTO] Security operation (e.g.: using SSL, HTTPS)

[BK- LICENSING] Operation related to the WOPE license

[BK-0001] Creation of a user context. This context is storedin the session; cookies are stored in this context.

[BK-0002] Verification of the resource path using thetarget.remap property

[BK-0404] Resource not found on the target

[BK-0501] Method not supported (e.g., not a GET or POST)

[BK-0500] Resource error on the target

[BK-0600] Resource cannot be saved to cache

[BK-0601] Resource cannot be read from cache

[BK-0602] Details of a cached resource

[BK-0604] Target selection (multi-site)

[BK-0800] Network exception on the target

[BK-0801] HTTP exception on the target

[BK-0802] HTML exception (e.g., invalid content)

[BK-0803] No Content-Type sent by a resource of the target

[BK-0804] URL cannot be compressed

Page 54: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 8. Operating WOPE

48

Code Description

[BK-0805] URL compression request

[BK-0806] JavaScript for the HTML widget cannot beloaded

[BK-0700] Image resizing operation failed

[BK-0701] Image details

[BK-0900] n/a

[BK-0901] JMX connector (of the WOPE container) error(e.g.: monitoring daemon)

[BK-0902] Details of a JMX exposition

Important

[BK-REDIRECT] All of the redirect URLs sent by a business application (for example, the value ofthe "Location" header), must be absolute and not relative. See the Developer Guide for more in-formation on this subject.

8.4.2. Collecting enhanced visitor logs in Apache formatWOPE has a logging mechanism that allows enhanced visitor logs to be generated based on theHTTPD Apache format.

By default, the location of the logs is not configured. Therefore, logging will be disabled.By default, thelocation of the logs is not configured. Therefore, logging will be disabled.

To enable logging, the location of the log files must be configured using the logfile property in thewope.ini configuration file. This property can be declared globally for all sites by placing it outside ofany section; or it can be declared per site by placing it in that site's section.

In Linux: logfile=/var/log/wope/access_log

In Windows: logfile=C:/wope/access_log

If the path points to a folder that does not exist, the folder will be created. (In this example /var/log/wope/ will be created.)

The logs will be rotated daily.

The logformat property defines the log format. (See Table 8.2, “Available log formats ”) The default logformat is a "combinedwrap". As with the logfile property, this value can be defined globally or per site.

Table 8.2. Available log formats

Value of the "logformat" property Log format

combined "combined" Apache format (http://httpd.apache.org/docs/cur-rent/logs.html#combined)

combinedwap (*) combined + space + bkalias

combinedwaptime combinedwap + space + request processing timein ms + space + target resource retrieval time inms + space

Page 55: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Collecting enhanced visitor logs in Apache format

49

Value of the "logformat" property Log formatNote: When a resource is served from the cache,the value written to the logs is "-".

combinedwapfull combinedwaptime + space + device model +space + device brand

Sample log entry with combinedwapfull:

10.51.209.1 - - [30/Sep/2009:23:59:57 +0200] "GET /bkimages/img/pict_retour.gif/227/306/GIF HTTP/1.1" 200 196 "-" "SAMSUNG-SGH-F480""SFR-123456" 220 20 "F480" "SAMSUNG"

Note

To calculate the total WOPE processing time, use the following formula in "combinedwaptime" or"combinedwapfull" modes:

total WOPE processing time = request processing time - target resource retrieval time

Take caching into consideration (target resource retrieval time will be "-").

Page 56: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

50

Page 57: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 9.

51

Best practices for securing and opti-mizing WOPEWe recommend that you follow those best practices when you deploy WOPE in production. They willhelp you to get the most out of WOPE .

9.1. Security best practicesYou should follow those best practices when deploying WOPE in production, especially if you are run-ning or intend to run in a PCI-DSS environment.

9.1.1. Remove unused webapps from your application serverMost application servers (including Apache Tomcat) come with a few demonstration and administra-tion webapps. We highly recommend that WOPE be the only webapplication deployed in your applica-tion server.

If you have followed installation instructions for Apache Tomcat, make sure that $CATALINA_HOME/webapps is empty before you start WOPE. For example, on Linux:

$ rm -fr $CATALINA_HOME/webapps/*

9.1.2. Enable requests loggingIn most countries, internet service providers are required to log all access to their servers and to keepthe log for at least one year. WOPE makes it easy to log all requests, and will automatically rotate thelog file every year.

We recommend that you always enable request logging in the general configuration of your WOPE in-stance. You can also add additional logging configuration for specific targets.

The logformat combinedwaptime will give you the best choice of useful information and perfor-mance.

To enable logging, please refer to: Section 8.4.2, “Collecting enhanced visitor logs in Apache format ”.

9.1.3. Make sure that the user source address is properly detectedIn most production environment, requests will not arrive directly from mobile users to WOPE . Instead,mobile users will probably connect through one or several reverse-proxy.

It is very important to make sure that WOPE is able to properly detect (and then log) the real IP ad-dress of the mobile user and not the IP address of the reverse proxy.

Go over the following steps to make sure that the user source address is properly detected:1. If you are using one or several reverse-proxy (or load balancer), set the general configuration op-

tion extract-forwarded-for to the value true (cf. Section 7.4.3.1, “Detecting the device ad-dress”).

2. Make sure that your reverse proxy sends the HTTP header X-Forwarded-For with the realsource IP address of the mobile user.

Page 58: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 9. Best practices for securing and optimizing WOPE

52

3. Make a few requests to your mobile site and look at the WOPE access logs to make sure that thesource IP address is correct.

9.1.4. Recognize secure usersWOPE sends a X-Bk-Secure-Request header to your targets if the connection between the mobileuser and WOPE is secure.

In most production environment, the request will come from the user to a reverse proxy (a load bal-ancer) and then be forwarded to WOPE . In this type of deployment, WOPE expects a http headerfrom the reverse proxy to let it know that the incoming request was using HTTPS.

You need to configure the secureLbHeader configuration variable with the name of the header sentby the reverse proxy (cf. Section 7.4.3.2, “Secure connection”).

9.1.5. Disable or firewall JMX accessFor obvious security reasons, you need to make sure that the TCP ports used by JMX are firewalledand thus can not be reached from outside your network. If in doubt, you can always disable JMX alto-gether.

9.1.6. Disable debuggingWOPE comes with a feature called debug mode and that can be enabled in the general configurationor per target (cf. Section 7.2.1, “Displaying errors in development mode”).

In production you should always disable this feature in the general configuration section.

9.1.7. Enable SSL between WOPE and your application.If the network between your WOPE instance and your target is not secure, we recommend that youuse a secure connection (cf. Section 7.4.5, “HTTPS configuration between WOPE and the HTML ap-plication”).

In production, you should always use valid SSL certificate and never use the target.selfsignedoption.

9.2. Performances

9.2.1. Use a recent Java Virtual MachineJava virtual machines have seen huge performance improvements in the last year. This makes a bigdifference when running WOPE . We highly recommend that you use Oracle's JVM version 6 or high-er.

9.2.2. Tune your Java Virtual MachineUse the -server option to force your JVM into server mode.

Use the -XX:MaxPermSize=128m to increase the permament generation in the JVM.

Use the -Xmx2048m startup parameter to define the maximum memory size given to your JVM. 1 gi-gabyte (1024m) is the recommended minimum. If you expect a lot of traffic on a multi-target instance,you can increase the memory size to 2048m or 4096m.

Page 59: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Tune the number of maximum connections to your target

53

Warning

You should always make sure that you leave enough memory to your operating system and toother applications on your server. Make sure that your server does not use its swap space whenrunning in production. If it does, reduce the memory allocated to WOPE or add memory to yourserver.

After following those recommandations, your $CATALINA_HOME/bin/setenv.sh should contain thefollowing line.

CATALINA_OPTS="-Xmx2048m -server -XX:MaxPermSize=128m"

9.2.3. Tune the number of maximum connections to your targetWOPE limits the number of connections to your target application to make sure that it does not getoverloaded. The default limit is set to 50 simultaneous connections and will limit the number of re-quests that can be processed at the same time.

You should increase this value if you are running in a high traffic environment. When tuning this value,keep in mind the following rules.• The maximum number of connections (proxy.maxTotalConnections) should be equal or slight-

ly lower than the maximum number of threads you want to use in your WOPE application server.

• The maximum number of connections per host (proxy.maxConnectionsPerHost) should nev-er exceed the maximum number of simultaneous connections or threads of any your target applica-tions.

• Make sure that all network equipments (firewall or reverse-proxy) are configured to allow at least thesame number of maximum connections.

• If you have only one target, the maximum number of connections per host should be equal to themaximum number of connections.

• If you have more than one target, and that all your targets have approximately the same traffic, themaximum number of connections per host will need to be smaller that the maximum number of con-nections.

9.2.4. Tune timeoutsTimeouts are an important performance feature. They help you make sure that WOPE does not getoverloaded when one of the target application is broken. If the timeouts are too high and somethinghappens on one of your target application, then your WOPE application server would waste lots of re-sources (threads, connections) waiting for the timeout to happen.

There are three timeouts that you can configure. They should be set to the smallest possible value.

9.2.4.1. Connection timeout (target.connectionTimeout)This timeout defines how long WOPE will wait before obtaining a TCP connection to the target applica-tion.

In most situation, this will be roughly equals to the time needed to ping your target and you can set asmall value (500 for example).

Page 60: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 9. Best practices for securing and optimizing WOPE

54

9.2.4.2. Socket timeout (target.soTimeout)This timeout defines how long WOPE will wait once the request to the target has been sent. This isthe time needed by your application server to process the request, access its database, eventually callsome webservices, etc.

For most complex application there are a few pages that need a few seconds to process the request.Therefore, the timeout should be set between 1 and 10 seconds (1000 to 10000).

9.2.4.3. AJAX timeout (target.ajaxTimeout)This is the timeout that will be used by the mobile user when waiting for an AJAX reply. It combinesthe time needed by your target application to process the request, generate the response, the timeneeded by WOPE to adapt and optimize the response and then the network time to send the responsedown to the mobile phone.

In most situation, we recommend that this timeout be approximately the double of the socket timeoutbut it should never be below 2 seconds because of mobile network latency. If your socket timeout isabove 5 seconds, then the AJAX timeout should be set to the socket timeout plus 5 seconds.

9.2.4.4. Connection expire timeout (connectionExpireTimeout)In WOPE there is a cron task (run each 12 seconds) that cleans idle connections that have been usedand put in the connection pool since a certain period connectionExpireTimeout. We are talkingabout HTTP connections that go from WOPE to your backend.

This must match the connectionTimeout of your target server. For Tomcat see Connector tag inserver.xml.

9.2.5. Enable minification and gzip smartlyWOPE can minify and compress your page and its ressources. This helps reduce the time needed tosend the resource to the mobile users but it can consume a lot of CPU power.

If your server is getting heavy traffic and you want to reduce WOPE CPU usage, you can disablethose features. You should also disable them if you have a load-balancer that is capable of doinghardware accelerated minification or gzip compression.

Use target.minimize=false to disable minification and target.gzip=false to disable gzipcompression.

9.2.6. Leverage the browser's cacheUsing HTTP headers, you can let the mobile browser know what resources can be cached. This willhelp reduce the number of requests from the mobile browser and will dramatically improve perfor-mance on the server and client side.

Refer to Section 7.4.4, “Managing the browser cache with WOPE” for more information on the headersyou should use.

Page 61: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 10.

55

Considerations when running WOPE ina PCI DSS compliant environment

10.1. A list of security best practicesAt its core, WOPE is an HTTP proxy. It can't enforce on its own all of the points required by the PCIDSS standard : both the developer of the HTML5 mobile service behind the WOPE proxy and the sys-tem administrator running WOPE have to make sure no security problems exist : the security mea-sures described below are best practices which MUST be followed in order to either aim for a PCIDSS compliance, or install WOPE in a PCI DSS environment.

The standard specification is available here : https://www.pcisecuritystandards.org/security_standards/documents.php

Note

Security measures described below are best practices and are not sufficient enough to cover fullPCI DSS compliance. Other measures like code auditing, injection attempts or intrusion detectionagainst the HTML5 mobile service are out of the scope of this document.

10.2. List of security measures for the mobile developer, orsystem administratorThe following security measures MUST be applied if WOPE is to be installed within a PCI DSS envi-ronment.

1. Verify the integrity of the WOPE WAR or EAR deliverable

You MUST compare the SHA1 hash against the obtained deliverable to make sure it has not beentampered with.

Both SHA1 and WAR/EAR files are available at http://delivery.wope-framework.com/backe-lite/wope/

2. Form values MUST be posted using the HTTP POST method, not the GET method.

Forms posted using the GET method may display credit card credentials within the URL : usePOST instead.

Because WOPE will use the GET method to display a form back to its state whenever the user hitsthe back button, this form helper has to be disabled : on every form, you MUST use the data-bk-preserve-method-on-back submit attribute to 'true' :

Example 10.1. Disabling the form helper

<input type="submit" name="submit" value="Submit" data-bk-preserve-method-on-back="true"/>

3. Credit card credentials MUST NOT be processed if the HTTP request is not secure.

Page 62: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 10. Considerations when running WOPE in a PCI DSS compliant environment

56

All URLS of the mobile service where credit card credentials are used MUST use the HTTPS pro-tocol.

WOPE will send the HTTP header X-Bk-Secure-Request to the HTML5 mobile service whenever itdetects a request is secure : for full details, please see Section 9.1.4, “Recognize secure users”.

The developer CAN use this header to prevent credit card credentials processing if the header val-ue is 'false'.

4. A credit card personal account number (PAN) MUST NOT be entirely visible in clear-text.

The developer of the HTML5 mobile service behind WOPE MUST mask parts of all PANs dis-played on the screen.

For example, for a 16 digits card number, the developer CAN replace the 14 first digits with a '*'masking character.

The developer MUST NOT use a masking character provided by a CSS @font-face font, becauseWOPE will not send CSS files to all devices and also because @font-face support is uneven be-tween mobile devices.

5. A credit card personal identifier (PIN) MUST NOT be displayed on screen, MUST NOT bewritten within log files, MUST NOT be shown within an error or information message, MUSTNOT be outputted in a javascript console.

The developer of the HTML5 mobile service MUST always hide the PIN.

Warning

Special consideration is due for log files : you MUST set the 'target.logMarkup' parameter to'false' in WOPE .ini configuration file so that the HTML markup does not get logged to disk.

Example 10.2. Disabling HTML markup logging

target.logMarkup=false

6. The JMX monitoring MUST be disabled : disable the login/password so that no one can usethe monitoring probe provided by WOPE.

Open your .ini configuration file, and set the 'monitoring.accounts' property to an empty value (thisis the default value)

Example 10.3. Disabling the JMX monitoring

monitoring.accounts=

7. Email-based error reporting MUST be disabled.

Whenever an error occurs, WOPE can be configured to send an error report by email. This report-ing MUST be disabled.

Page 63: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

List of security measures for the mobile developer, or system administrator

57

Open your .ini configuration file, and set the 'pipelineerrors.sendEmail' property to 'false' (this isthe default value)

Example 10.4. Disabling the error reporting

pipelineerrors.sendEmail=false

8. WOPE MUST NOT run in debug mode.

While the mobile service is being developed, WOPE can run in a 'debug' - or 'developer' - mode toease the development. When the service is in production, the 'debug' mode MUST be disabled.

Open your .ini configuration file, and set the 'target.debug' property to 'false' (this is the default val-ue)

Example 10.5. Disabling the error reporting

target.debug=false

Page 64: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

58

Page 65: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 11.

59

Load testing

11.1. IntroductionIn this chapter, we describe how to run a load tests using Tsung.

Tsung is a distributed load testing tool that is available free of charge as an open source softwareproduct.

11.2. PrerequisiteBefore running the tests, you need to :

• Download and install Tsung 1.5.01

• Download the test scenario wope-6.0.30-perf.zip on http://delivery.wope-framework.com/

• Download the HTML pages used by the scenario, wope-demo-6.0.30.war file on http://delivery.wope-framework.com/.

• Run a WOPE instance targeting the above-mentioned HTML pages.

11.3. Running the load test scenario1. Open the wope-6.0.30-perf.zip.

2. Extract all the files from this archive to a local directory.

3. Edit the host.xml file.

Set the host of the WOPE instance.

Copy this host name in the WOPE configuration file wope.ini:

Example 11.1. wope.ini

[...][WOPE-host-name]target.host=wope-demo-htmltarget.port=80target.contextPath=[...]

4. Edit the tsung.xml file.

Example 11.2. tsung.xml

[...]<servers> <server host="&host" port="3060" type="tcp"/></servers>[...]

1 http://tsung.erlang-projects.org/

Page 66: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 11. Load testing

60

Set the HTTP port of the WOPE instance.

5. Make sure the machine running the WOPE instance has an SSH server installed.

Add the public key of the machine running Tsung on the machine running the WOPE instance.This is needed for CPU and RAM load monitoring.

Make sure the forwarding agent is activated on the servers by adding:

Example 11.3. .ssh/config file

Host *ForwardAgent yesForwardX11 yes

6. a. Warm up the JVM before running the load test:

Edit the tsung.xml file.

At the begining of the document, replace the line

<!ENTITY load SYSTEM "./load.xml">

by

<!ENTITY load SYSTEM "./load-warm.xml">

Launch the test using tsung -f /your_local_path/tsung.xml start.

Do it twice for a proper warm up.

b. Once the JVM is warm, run the load test:

Edit the tsung.xml file.

At the begining of the document, replace the line

<!ENTITY load SYSTEM "./load.xml">

by

<!ENTITY load SYSTEM "./load-success.xml">

Launch the test using tsung -f /your_local_path/tsung.xml start.

7. To generate the graphs, use /usr/lib/tsung/bin/tsung_stats.pl (Ubuntu OS) in the logdirectory created by tsung.

11.4. Our resultsThis scenario has been run on a dedicated server using Intel Xeon 5140 @ 2.33GHz processor with 8Go of RAM on Ubuntu 12.04.

Page 67: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Our results

61

Our results can be found in the wope-6.0.30-perf.zip archive, in the following files:• report.html

• graph.html

Page 68: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

62

Page 69: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 12.

63

Appendixes

12.1. List of WOPE configuration parametersThese parameters can be overridden in the configuration file wope.ini

12.1.1. Global parameters

Note

When using the same WOPE instance with several targets (multi-site), all of the targets will sharethese same parameters.

Table 12.1. Global parameters

Property Default value Comments

extract-forwarded-for false Use the X-Forwarded-ForHTTP header to determine theIP address of the device.

license.file.url Mandatory—path to the WOPElicense

Table 12.2. Error management

Property Default value Comments

pipelineerrors.smtphost The address of the SMTP serv-er to be used to send emails(e.g.: smtp.monsite.com)

pipelineerrors.bkmlBufferingEnabledtrue

pipelineerrors.sendEmail false Activate sending of emails

pipelineerrors.emailFrom Sender (e.g.: [email protected])

pipelineerrors.emailTo Recipient (e.g.:[email protected])

pipelineerrors.emailSubject Subject (e.g.: "[WOPE ] Er-ror report - {URL}") Note: the{URL} string will be replaced bythe full (uncompressed) URLthat generated the error.

pipelineerrors.logPipelineErrors true

Table 12.3. Secure connection

Property Default value Comments

secureLbHeader X-LB-Secure The name of a HTTP headerset by an upfront load balancerwhen the request is secure.This header value must be setto 'true' when the request if se-cure.

Page 70: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 12. Appendixes

64

Table 12.4. Access log

Property Default value Comments

logformat combinedwap Log formats: combined, com-binedwap, combinedwaptime,combinedwapfull

Table 12.5. Configuration of the parser pool

Property Default value Comments

parserPool.initIdleCapacity 10

parserPool.maxIdle 100

Table 12.6. HTTP proxy parameters

Property Default value Comments

proxy.maxConnectionsPerHost 50 Max simultaneous HTTP con-nections allowed to target.host(e.g.: 50)

proxy.maxTotalConnections ${proxy.maxConnectionsPerHost}Must be defined withproxy.maxConnectionsPerHost

Table 12.7. Supervision

Property Default value Comments

supervisionSuccess OK String returned when /supervision.jsp is queried

12.1.2. Per target configuration parametersTable 12.8. WOPE to application server general configuration parameters (the application server is theHTML webapp/application targeted from WOPE)

Property Default value Comments

target.frameworkEnabled true Enable or disable WOPEFramework component : whenset to false, all UI Widgets andanimations/transitions be dis-abled. For example if you on-ly want to apply WOPE Accel-erator features to an existingweb site, you can disable theFramework component.

target.protocol http Protocol (http or https)

target.host demov6.wope.mobi Address of the server hostingthe HTML application (e.g.:myhtml5site.com)

target.port 80 Port of the server hosting theHTML application (e.g.: 80)

target.contextPath Empty, or containing thepath after target.host (e.g.:if the target.contextPath at-tribute is defined, all of thetraffic requested by WOPEto the target will be served at

Page 71: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Per target configuration parameters

65

Property Default value Commentshttp://target.host(target.port)/target.contextPath). Note: Seealso Using the target.remapattribute in association withtarget.contextPath.

target.remap Force rewritten virtual files

target.selfsigned false Whether a self-signed certifi-cate may be used

target.wurflCapacities List of device features informa-tion WOPE will send as HTTPheaders to the HTML applica-tion

target.mutualAuthRequired false Set to true whenever two-wayHTTPS authentication betweenWOPE and HTML application isrequired

target.client.keyStore Full path to the keystore con-taining the client certificate

target.client.trustStore Full path to the truststore con-taining the server certificate

target.client.keyStore.password keystore password

target.client.trustStore.password truststore password

target.redirect.website.url Absolute URL of a non-mo-bile web site. Enable to redirectdesktop browsers to a non-mo-bile version of your HTML site.

target.connectionTimeout 5000 Connection timeout to the tar-get server (milliseconds)

target.soTimeout 5000 Response time of the targetserver (milliseconds)

target.ajaxTimeout 10000 Response time of the targetserver for Ajax requests (mil-liseconds)

target.username Username for HTTP Basic Au-thentication

target.password Password for HTTP Basic Au-thentication

target.minimize true Minifies all JavaScript and CSSresources

target.gzip true Compresses HTML, bk.js andbk.css resources using GZIPalgorithm

target.resizeImages true Set this to "false" to disable im-ages resizing

target.resizeAbsoluteImgUrlsGiventargetHost WOPE will by default resize ab-solute URL images whenever

Page 72: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Chapter 12. Appendixes

66

Property Default value Commentsan absolute URL matches theURL of the target.host URL setin the INI configuration prop-erty. If you want to resize ab-solute images which URL arethe same as the URL in the ad-dress bar of the browser, setthe value to "host".

target.atInternetSiteId Site ID provided by AT Inter-net1.

target.atInternetServerUrl Server URL provided byAT Internet2 (ex: http://logiXXX.xiti.com/hit.xiti).

target.googleAnalyticsAccountId Google Analytics account IDprovided by Google Analytics3.

target.useWopeLocalPageCache false Set this to 'true' to enable pagecaching within WOPE internalcache

Table 12.9. Error management

Property Default value Comments

target.debug false Show error details (developermode)

target.errorBundle Path to the ZIP or uncom-pressed archive containingproxy error pages to be usedwhenever the HTML applicationis down.

target.js.logLevel error Set the Javascript log level.Available levels are: debug, in-fo, warn, error, off

target.logMarkup true Whether to write HTML markupwithin logged exceptions or not.Must be set to 'false' if you areusing WOPE in a PCI DSS en-vironment, see Section 10.2,“List of security measures forthe mobile developer, or sys-tem administrator”.

1 http://www.atinternet.com/2 http://www.atinternet.com/3 http://www.google.com/analytics/

Page 73: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

Redirect rules for mobile phones for an Apache Web server + mod_rewrite module

67

12.2. Redirect rules for mobile phones for an Apache Webserver + mod_rewrite moduleTo automatically redirect mobile phones accessing your site to your site's mobile version, youcan use the Apache htaccess redirect rules file available at the bottom of the http://delivery.wope-framework.com/backelite/wope/ page, 'Tools' section. Rename the file to '.htaccess' once downloaded.Also make sure your rewriting module is enabled (use 'a2enmod rewrite' to enable it).

12.3. Third-party libraries used by WOPEThe list of the third party libraries used is found in the WOPE deliverable, under META-INF/THIRD-PARTY.txt.

Page 74: Operating handbook WOPE 6.0 · 2017. 6. 30. · Table 3.1. Verification stage: Apache Tomcat installation Step 1 : Check that Apache Tomcat is cor-rectly installed 1. Edit the server.xml

68