Apache forward proxy

How to install a forward proxy:

  1. In a typical multi-host environment, you need to add a virtual server to the apache configuration. In order to do that, add a file (e.g. ForwardProxy.conf) to the sites-available directory. This file must contain the following configuration lines for the proxy to listen on port 8080:

    ProxyRequests On
    ProxyVia On

    Require ip 192.168

    ErrorLog /var/log/apache2/error_ForwardProxy.log
    CustomLog /var/log/apache2/access_ForwardProxy.log combined

  2. You need to enable the modules proxy, proxy_http, and proxy_connect.
  3. In the mods-enabled/proxy.conf file, you need to uncomment the "ProxyRequests On" line and the following block.
  4. In the ports.conf file, you need to add the line "Listen 8080" below the line "Listen 80"
  5. Don't forget to enable the mods, the virtual server, and to restart the server to activate the changes!