Andy Davies

Web Performance Consultant

Configuring an ‘all-in-one’ WebPageTest Private Instance

WebPageTest (WPT) is a great tool and the public instances cover many scenarios but sometimes I need a private instance, for example when testing sites that aren't publicly accessible yet or debugging a script.

Setting up a private instance is reasonably straightforward but there are a few gotchas and some settings aren’t always obvious the first time around.

I’ve been asked by a few people how I set up instances, so these notes explain the steps I follow to create an ‘all in one’ installation with the server and test agents on same machine.

The notes are based on WPT install guide and can also be used as a guide to creating separate a server and agents, although I’d use a Linux variant for the server in that case.

Base Windows Configuration

Start with a fresh Windows 7 install (I used 32-bit Professional, the virtual machines Microsoft make available for browser testing are another option but stick with 32bit)

  • Create a user with local administrator rights and set them to log in automatically when the machine starts up. (this has security implications and some network managers may not like it)

  • Turn off UAC

  • Turn off any screensaver

  • In the power saving settings choose never as the options for turning off the display and putting the computer to sleep

  • Set firewall rules to allow port 80 & 443 TCP inbound

  • Add shortcuts for Shutdown and Restart

When accessed via Remote Desktop (RDP), Windows 7 doesn’t display the Restart and Shutdown options on the Start menu, so I add shortcuts for them:

Shutdown : shutdown -f -s -t 1

Restart : shutdown -f -r -t 1

I also add Notepad++ and 7zip so I have a decent text editor and archiving tool

Server Installation

Install Apache

  • Download and install Apache. Apache 2.2 is currently the most recent version with a Windows binary.

  • Edit C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf

  • Update the configuration to include the following:

DocumentRoot "C:/wpt-www/"

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

<Directory "C:/wpt-www/">
        AllowOverride all
        Order allow,deny
        Allow from all
</Directory>

<IfModule dir_module>
    DirectoryIndex index.html index.php
</IfModule>

Uncomment these modules

LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
LoadModule rewrite_module modules/mod_rewrite.so

Add the PHP module (installed in next step)

LoadModule php5_module "C:\Program Files\PHP\php5apache2_2.dll"

Install PHP

  • Download PHP from http://windows.php.net/download (I used the zip of 5.4.7 VC9 Threadsafe)

  • Extract and copy contents to c:\program files\php

  • Copy c:\program files\php\php.ini-production to c:\windows\php.ini

  • Edit c:\windows\php.ini

Update the extension_dir path, and uncomment the php_gd2 extension

extension_dir = "C:\program files\php\ext"
extension=php_gd2.dll

(zip and zlib are on by default in 5.4.7)

Install WPT server

Editing locations.ini is the probably the area I make the most errors and it can be confusing until you grasp it’s hierarchical nature.

The browser configuration labels must match the labels used in urlblast.ini and wptdriver.ini in the test agent configurations.

I name my labels as location-testdriver pairs e.g. local-urlblast (for IE) or local-wptdriver (for Chrome and Firefox)

copy c:\wpt-www\settings\locations.ini.sample to c:\wpt-www\settings\locations.ini

edit c:\wpt-www\settings\locations.ini

This is a sample config that matches the test agents below, more locations can be added:

[locations]
1=Local
default=Local

;
; These are the top-level locations that are listed in the location dropdown
; Each one points to one or more browser configurations
;

[Local]
1=Local-URLBlast
2=Local-WPTDriver
label=Local

;
; These are the browser-specific configurations that match the configurations
; defined in the top-level locations.  Each one of these MUST match the location
; name configured on the test agent (urlblast.ini or wptdriver.ini)
;

[Local-URLBlast]
browser=IE 9
latency=0
label="Local - IE 9"
;browserExe=pagetest.exe
;key=TestKey123

;
; For a wptdriver configuration (chrome, firefox), the browser labels here 
; MUST match the labels used in wptdriver.ini
;

[Local-WPTDriver]
browser=Chrome,Firefox
label="Local"
  • Restart Apache

  • Fire up a browser and navigate to 127.0.0.1 and you should see the Web Page Test Private Instance home page.

Test-Agent Configuration

  • Extract the contents of the agent folder from webpagetest.2.7.2.zip into c:\wpt-agent

  • Install Chrome and Firefox (if you want them of course)

  • Install ffmpeg (http://ffmpeg.zeranoe.com/builds/) and add its bin folder to the path. I tend to install it in c:\program files\ffmpeg

  • Install AVISynth using the installer in c:\wpt-agent

  • Install the DUMMYNET ipfw driver

WPT 2.10 introduced a 64bit version of dummynet. Depending on your platform choose the version of dummynet you require and copy the contents of the 32bit or 64bit folder into c:\wpt-agent\dummynet.

  1. In the properties of the Network Adapter used for Internet access
  2. Click "Install"
  3. Select "Service" and click "Add"
  4. Click "Have Disk" and navigate to c:\wpt-agent\dummynet
  5. Select the ipfw+dummynet service (and click through any warnings about the driver being unsigned)

If you’re connected via RDP you may lose the connections while installing ipfw plus dummynet and need to re-connect.

  • In the startup folder, create shortcuts to c:\wpt-agent\dummynet\ipfw.cmd, c:\wpt-agent\urlblast.exe and c:\wpt-agent\wptdriver.exe

  • Configure IE

Copy c:\wpt-agent\urlblast.ini.sample to c:\wpt-agent\urlblast.ini

Edit c:\wpt-agent\urlblast.ini

The Location entry must match the location label for the IE section of locations.ini

[Configuration]
Startup Delay=30
Log File=c:\wpt-agent\agent\urlblast
Timeout=120
use current account=1

; Where to get work from
Url Files Url=http://127.0.0.1/work/
Location=Local-URLBlast
;Location Key=TestKey123
  • Configure Chrome and Firefox

Copy c:\wpt-agent\wptdriver.ini.sample to c:\wpt-agent\wptdriver.ini

Edit c:\wpt-agent\wptdriver.ini

Again the location entry name must match the revelant section in the server locations.ini

I update the software paths to retrieve updates from the local machine rather than webpagetest.org but that's a personal preference

[WebPagetest]
url=http://127.0.0.1/
location=Local-WPTDriver
browser=chrome
;key=TestKey123
;Automatically install and update support software (Flash, Silverlight, etc)
software=http://127.0.0.1/installers/software.dat

[chrome]
exe="C:\Program Files\Google\Chrome\Application\chrome.exe"
options='--load-extension="%WPTDIR%\extension" --user-data-dir="%PROFILE%" --no-proxy-server'
installer=http://127.0.0.1/installers/browsers/chrome.dat

[Firefox]
exe="C:\Program Files\Mozilla Firefox\firefox.exe"
options='-profile "%PROFILE%" -no-remote'
installer=http://127.0.0.1/installers/browsers/firefox.dat
template=firefox
  • Clearing prompts and warnings

Launch each browser and clear the prompts e.g. should it load extensions, should it be the default browser etc.

From the startup folder launch urlBlast, wptdriver and ipfw.cmd manually. Give each of them permission to run even though they’re unsigned, and uncheck the ‘always do this box’

Restart the machine

Whenever you RDP into a WPT test agent, you should always restart the machine as the Window lock screen is displayed when disconnecting RDP.

You should now have a working ‘all in one’ install of Web Page Test, point your browser at the WPT machine and launch tests for IE, Firefox and Chrome just to check they work.

If you've got any questions or spot any mistakes feel free to leave a comment or drop me an email.

There's also a troubleshooting guide for the most common problems at the foot of the main WPT installation instruction (https://sites.google.com/a/webpagetest.org/docs/private-instances)

If you want to discuss private instances further or need help WebPageTest Forum for Private Instances is the place to go.

Updates

30 Apr 2013 - Added 32bit / 64bit dummynet details 1 Mat 2013 - Corrected extraction of agent from zip and uncheck of "allways check this"

Comments