- sudo apt-get update -qq
 
 install:
-  - composer self-update && composer install
   - sudo apt-get install -y apache2 libapache2-mod-fastcgi
+  - sudo apt-get install -y privoxy
+  - composer self-update && composer install
 
 before_script:
   # Disable xdebug. NB: this should NOT be done for hhvm...
   - if [ $TRAVIS_PHP_VERSION != "hhvm" -a $TRAVIS_PHP_VERSION != "7.0" ]; then phpenv config-rm xdebug.ini; fi
 
   # We set up an Apache instance inside the Travis VM and test it.
-  - if [ '$TRAVIS_PHP_VERSION' != 'hhvm' ]; then ./tests/ci/travis/install_apache.sh; fi
-  - if [ '$TRAVIS_PHP_VERSION' = 'hhvm' ]; then ./tests/ci/travis/install_apache_hhvm.sh; fi
-  - ./tests/ci/travis/install_nginx.sh
+  - if [ '$TRAVIS_PHP_VERSION' != 'hhvm' ]; then ./tests/ci/travis/setup_apache.sh; fi
+  - if [ '$TRAVIS_PHP_VERSION' = 'hhvm' ]; then ./tests/ci/travis/setup_apache_hhvm.sh; fi
+  - ./tests/ci/travis/setup_privoxy.sh
 
 script:
   # to have code coverage: --coverage-clover=coverage.clover
 
+++ /dev/null
-#!/bin/sh
-
-# enable nginx (to serve as proxy)
-
-sudo apt-get install nginx
-sudo cp -f tests/ci/travis/nginx.conf /etc/nginx/nginx.conf
-sudo service nginx restart
 
+++ /dev/null
-worker_processes 1;
-
-events {
-    worker_connections 1024;
-}
-
-http {
-    #include mime.types;
-    #default_type application/octet-stream;
-    gzip on;
-
-    server {
-        listen 8080;
-        location / {
-            proxy_pass http://localhost;
-            proxy_set_header Host $host;
-            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
-            proxy_redirect off;
-        }
-    }
-}
\ No newline at end of file
 
--- /dev/null
+listen-address 127.0.0.1:8080
 
 # enable php-fpm
 # @see https://github.com/travis-ci/travis-ci.github.com/blob/master/docs/user/languages/php.md#apache--php
 
-sudo apt-get install apache2 libapache2-mod-fastcgi
 sudo a2enmod rewrite actions fastcgi alias
 
 # enable php-fpm
 sudo cp -f tests/ci/apache_vhost /etc/apache2/sites-available/default
 sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/default
 sudo service apache2 restart
+
+sudo echo "$(pwd) !!!"
 
 # enable hhvm-fcgi
 # @see https://github.com/travis-ci/travis-ci.github.com/blob/master/docs/user/languages/php.md#apache--php
 
-sudo apt-get install apache2 libapache2-mod-fastcgi
 sudo a2enmod rewrite actions fastcgi alias
 
 # start HHVM
 # configure apache virtual hosts
 sudo cp -f tests/ci/travis/apache_vhost_hhvm /etc/apache2/sites-available/default
 sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/default
-sudo service apache2 restart
\ No newline at end of file
+sudo service apache2 restart
 
--- /dev/null
+#!/bin/sh
+
+# configure privoxy
+
+sudo cp -f tests/ci/travis/privoxy /etc/privoxy/config
+sudo service privoxy restart