jeltsch's blog

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

Counting files (list and word count, ls & wc)

How do you count the number of files in a directory? That becomes non-trivial if you have thousands of files in a directory. Your file manager chokes on counting them, especially if they are not local. On the Linux command line, this task is fast and easy:
ls | wc
ls lists your files one per row and wc returns three numbers: lines, words and bytes. In the file counting example, lines and words are the same and equal the number of files in the directory.

Pages