Skip to content

Instantly share code, notes, and snippets.

@e7d
Last active October 22, 2025 12:09
Show Gist options
  • Save e7d/1f784339df82c57a43bf to your computer and use it in GitHub Desktop.
Save e7d/1f784339df82c57a43bf to your computer and use it in GitHub Desktop.

Revisions

  1. e7d revised this gist Jan 4, 2017. 1 changed file with 5 additions and 9 deletions.
    14 changes: 5 additions & 9 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -21,7 +21,7 @@ If you don't want to build Squid from scratch, you can simply [Setup a Squid ano
    * [Additional configuration](#additional-configuration)
    * [Customize settings](#customize-settings)
    * [Disable authentication](#disable-authentication)
    * [Manage user accounts](#manage-user-accounts)
    * [Manage users](#manage-users)

    ## Automated install

    @@ -184,14 +184,10 @@ This authentication relies on a password file you will find at `/etc/squid/users

    This user file may be modified following the next section instructions.

    ### Manage user accounts
    ### Manage users

    Using the command [htpasswd](https://httpd.apache.org/docs/current/programs/htpasswd.html), you can manage the users able to use the proxy.

    To add or update a user:
    `htpasswd -bd /etc/squid/users.pwd johndoe mypw`

    To remove a user:
    `htpasswd -D /etc/squid/users.pwd johndoe`
    Using the command [htpasswd](https://httpd.apache.org/docs/current/programs/htpasswd.html), you can manage the users able to use the proxy:
    - create/update a user: `htpasswd -bd /etc/squid3/users.pwd myuser mypw`
    - remove a user: `htpasswd -D /etc/squid3/users.pwd myuser`

    **NOTE:** Provided authentication relies on CRYPT algorithm. Information defined in `users.pwd` must respect that, meaning that passwords can only be up to 8 characters.
  2. e7d revised this gist Jan 4, 2017. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    If you don't want to build Squid from scratch, you can simply [Setup a Squid anonymous proxy](https://gist.github.com/e7d/9472c3e7ac1821056867b95244c73609)

    # Build a Squid anonymous proxy from source code

    > Please note that this whole manual refers to the version **3.5.23** of Squid. You probably would have to adapt some commands to the version you will actually download.
  3. e7d revised this gist Jan 4, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -112,7 +112,7 @@ With this sample configuration file, you can use a Htpasswd file at `/etc/squid/

    ```
    rm -rf /etc/squid/users.pwd
    touch -cbd /etc/squid/users.pwd
    htpasswd -cbd /etc/squid/users.pwd proxy proxy
    ```

  4. e7d revised this gist Jan 4, 2017. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -16,8 +16,8 @@
    * [Build service runtime](#build-service-runtime)
    * [Prepare execution folders](#prepare-execution-folders)
    * [Start!](#start)
    * [Going further](#going-further)
    * [Customize configuration](#customize-configuration)
    * [Additional configuration](#additional-configuration)
    * [Customize settings](#customize-settings)
    * [Disable authentication](#disable-authentication)
    * [Manage user accounts](#manage-user-accounts)

    @@ -150,11 +150,11 @@ squid -z

    Try to start your brand new Squid with `service squid start`

    ## Going further
    ## Additional configuration

    ### Customize configuration
    ### Customize settings

    Squid offers some interesting customisation options you should have a look at. Every of this suggestions implies a modification of the file located at `/etc/squid/squid.conf`.
    Squid offers some interesting customisation options you should have a look at. This modifications implies to edit the file located at `/etc/squid/squid.conf`.

    #### Listening ports

  5. e7d revised this gist Jan 4, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -184,7 +184,7 @@ This user file may be modified following the next section instructions.

    ### Manage user accounts

    Using the command [htpasswd](https://httpd.apache.org/docs/current/programs/htpasswd.html), you will be able to manage the IDs of the users able to use the proxy.
    Using the command [htpasswd](https://httpd.apache.org/docs/current/programs/htpasswd.html), you can manage the users able to use the proxy.

    To add or update a user:
    `htpasswd -bd /etc/squid/users.pwd johndoe mypw`
  6. e7d revised this gist Jan 4, 2017. 3 changed files with 8 additions and 8 deletions.
    10 changes: 5 additions & 5 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -18,7 +18,7 @@
    * [Start!](#start)
    * [Going further](#going-further)
    * [Customize configuration](#customize-configuration)
    * [Enable authentication](#enable-authentication)
    * [Disable authentication](#disable-authentication)
    * [Manage user accounts](#manage-user-accounts)

    ## Automated install
    @@ -112,12 +112,12 @@ With this sample configuration file, you can use a Htpasswd file at `/etc/squid/

    ```
    rm -rf /etc/squid/users.pwd
    wget --no-check-certificate -O /etc/squid/users.pwd https://gist.github.com/e7d/1f784339df82c57a43bf/raw/users.pwd
    touch -cbd /etc/squid/users.pwd
    ```

    > To enable this authentication, you will have to uncomment the **Authentication** section of the sample `squid.conf` configuration file. See [Enable authentication](#enable-authentication).
    > You can create your users entries using the [htpasswd](http://httpd.apache.org/docs/current/programs/htpasswd.html) tool from Apache. i.e. `htpasswd -db /etc/squid/users.pwd jones fx5rm31s` will create a user "jones" with the password "fx5rm31s" inside the "/etc/squid/users.pwd" file. See [Manage user accounts](#manage-user-accounts).
    > This this authentication is enabled by default/ To disable it you will have to comment the **Authentication** section of the sample `squid.conf` configuration file. See [Disable authentication](#disable-authentication).
    > You can create your users entries using the [htpasswd](http://httpd.apache.org/docs/current/programs/htpasswd.html) tool from Apache. See [Manage user accounts](#manage-user-accounts).
    > You can directly use the [users.pwd](https://gist.github.com/e7d/1f784339df82c57a43bf/raw/users.pwd) sample, providing you a basic user named *proxy*, using also *proxy* as password.
    ### Build service runtime
    @@ -166,7 +166,7 @@ http_port 3128
    ```

    ### Enable authentication
    ### Disable authentication

    Your proxy will respond to any request. If you want to limit its accessibility to a set of users, you may want to enable authentication, by uncommenting the following section:

    4 changes: 2 additions & 2 deletions squid.conf
    Original file line number Diff line number Diff line change
    @@ -61,8 +61,8 @@ auth_param basic realm Proxy
    auth_param basic credentialsttl 2 hours
    auth_param basic casesensitive on

    #acl Users proxy_auth REQUIRED
    #http_access allow Users
    acl Users proxy_auth REQUIRED
    http_access allow Users

    # Access Restrictions

    2 changes: 1 addition & 1 deletion users.pwd
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    proxy:V3SumwH0Poabk
    proxy:5qHyKopcCn9NA
  7. e7d revised this gist Jan 4, 2017. 2 changed files with 4 additions and 3 deletions.
    5 changes: 3 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -53,8 +53,9 @@ deb-src http://security.debian.org/ stable/updates main
    Build Squid 3 dependencies

    ```
    aptitude update
    aptitude build-dep squid3
    apt-get update
    apt-get install build-essential libssl-dev apache2-utils
    apt-get build-dep squid3
    ```

    2 changes: 1 addition & 1 deletion squid.conf
    Original file line number Diff line number Diff line change
    @@ -55,7 +55,7 @@ acl CONNECT method CONNECT
    # This sections uses a Htpasswd file named `users.pwd` file to store eligible accounts.
    # You can generate yours using the htpasswd command from "apache2-utils" aptitude package, using "-d" flag to use system CRYPT.

    auth_param basic program /usr/lib/squid3/basic_ncsa_auth /etc/squid/users.pwd
    auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/users.pwd
    auth_param basic children 5
    auth_param basic realm Proxy
    auth_param basic credentialsttl 2 hours
  8. e7d revised this gist Jan 4, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -87,7 +87,7 @@ make install

    ### Resolve library dependencies

    Extract the content of [squid-lib.tar.gz](http://e7d.github.io/resources/squid-lib.tar.gz) to `/usr/lib`
    Extract the content of [squid-lib-3.4.8.tar.gz](http://e7d.github.io/resources/squid-lib-3.4.8.tar.gz) to `/usr/lib`

    ```
    cd /usr/lib
  9. e7d revised this gist Jan 4, 2017. 3 changed files with 9 additions and 9 deletions.
    8 changes: 4 additions & 4 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -91,9 +91,9 @@ Extract the content of [squid-lib.tar.gz](http://e7d.github.io/resources/squid-l

    ```
    cd /usr/lib
    wget http://e7d.github.io/resources/squid-lib.tar.gz
    wget -O /usr/lib/squid-lib.tar.gz http://e7d.github.io/resources/squid-lib-3.4.8.tar.gz
    tar zxvf squid-lib.tar.gz
    rm squid_lib.tar.gz
    rm squid-lib.tar.gz
    ```

    @@ -102,15 +102,15 @@ rm squid_lib.tar.gz
    Copy [squid.conf](https://gist.github.com/e7d/1f784339df82c57a43bf/raw/squid.conf) contents to `/etc/squid/squid.conf`.

    ```
    rm -fr /etc/squid/squid.conf
    rm -rf /etc/squid/squid.conf
    wget --no-check-certificate -O /etc/squid/squid.conf https://gist.github.com/e7d/1f784339df82c57a43bf/raw/squid.conf
    ```

    With this sample configuration file, you can use a Htpasswd file at `/etc/squid/users.pwd` to manage a basic authentication.

    ```
    rm -fr /etc/squid/users.pwd
    rm -rf /etc/squid/users.pwd
    wget --no-check-certificate -O /etc/squid/users.pwd https://gist.github.com/e7d/1f784339df82c57a43bf/raw/users.pwd
    ```
    8 changes: 4 additions & 4 deletions squid-install.sh
    Original file line number Diff line number Diff line change
    @@ -46,18 +46,18 @@ make install

    echo "Download libraries"
    cd /usr/lib
    wget -O /usr/lib/squid-lib.tar.gz http://e7d.github.io/resources/squid-lib.tar.gz
    wget -O /usr/lib/squid-lib.tar.gz http://e7d.github.io/resources/squid-lib-3.4.8.tar.gz

    echo "Install libraries"
    tar zxvf squid-lib.tar.gz

    echo "Create configuration file"
    rm -fr /etc/squid/squid.conf
    rm -rf /etc/squid/squid.conf
    wget --no-check-certificate -O /etc/squid/squid.conf https://gist.github.com/e7d/1f784339df82c57a43bf/raw/squid.conf

    echo "Create users database sample"
    rm -fr /etc/squid/users.pwd
    htpasswd -c -b -d /etc/squid/users.pwd proxy proxy
    rm -rf /etc/squid/users.pwd
    htpasswd -cbd /etc/squid/users.pwd proxy proxy

    echo "Create service executable file"
    wget --no-check-certificate -O /etc/init.d/squid https://gist.github.com/e7d/1f784339df82c57a43bf/raw/squid.sh
    2 changes: 1 addition & 1 deletion squid.conf
    Original file line number Diff line number Diff line change
    @@ -55,7 +55,7 @@ acl CONNECT method CONNECT
    # This sections uses a Htpasswd file named `users.pwd` file to store eligible accounts.
    # You can generate yours using the htpasswd command from "apache2-utils" aptitude package, using "-d" flag to use system CRYPT.

    auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/users.pwd
    auth_param basic program /usr/lib/squid3/basic_ncsa_auth /etc/squid/users.pwd
    auth_param basic children 5
    auth_param basic realm Proxy
    auth_param basic credentialsttl 2 hours
  10. e7d revised this gist Jan 4, 2017. 1 changed file with 4 additions and 10 deletions.
    14 changes: 4 additions & 10 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -115,8 +115,8 @@ wget --no-check-certificate -O /etc/squid/users.pwd https://gist.githubuserconte
    ```

    > To enable this authentication, you will have to uncomment the **Authentication** section of the sample `squid.conf` configuration file.
    > You can create your users entries using the [htpasswd](http://httpd.apache.org/docs/current/programs/htpasswd.html) tool from Apache. i.e. `htpasswd -db /etc/squid/users.pwd jones fx5rm31s` will create a user "jones" with the password "fx5rm31s" inside the "/etc/squid/users.pwd" file.
    > To enable this authentication, you will have to uncomment the **Authentication** section of the sample `squid.conf` configuration file. See [Enable authentication](#enable-authentication).
    > You can create your users entries using the [htpasswd](http://httpd.apache.org/docs/current/programs/htpasswd.html) tool from Apache. i.e. `htpasswd -db /etc/squid/users.pwd jones fx5rm31s` will create a user "jones" with the password "fx5rm31s" inside the "/etc/squid/users.pwd" file. See [Manage user accounts](#manage-user-accounts).
    > You can directly use the [users.pwd](https://gist.github.com/e7d/1f784339df82c57a43bf/raw/users.pwd) sample, providing you a basic user named *proxy*, using also *proxy* as password.
    ### Build service runtime
    @@ -186,15 +186,9 @@ This user file may be modified following the next section instructions.
    Using the command [htpasswd](https://httpd.apache.org/docs/current/programs/htpasswd.html), you will be able to manage the IDs of the users able to use the proxy.

    To add or update a user:
    ```
    htpasswd -bd /etc/squid/users.pwd johndoe mypw
    ```
    `htpasswd -bd /etc/squid/users.pwd johndoe mypw`

    To remove a user:
    ```
    htpasswd -D /etc/squid/users.pwd johndoe
    ```
    `htpasswd -D /etc/squid/users.pwd johndoe`

    **NOTE:** Provided authentication relies on CRYPT algorithm. Information defined in `users.pwd` must respect that, meaning that passwords can only be up to 8 characters.
  11. e7d revised this gist Jan 4, 2017. 1 changed file with 54 additions and 0 deletions.
    54 changes: 54 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -16,6 +16,10 @@
    * [Build service runtime](#build-service-runtime)
    * [Prepare execution folders](#prepare-execution-folders)
    * [Start!](#start)
    * [Going further](#going-further)
    * [Customize configuration](#customize-configuration)
    * [Enable authentication](#enable-authentication)
    * [Manage user accounts](#manage-user-accounts)

    ## Automated install

    @@ -144,3 +148,53 @@ squid -z
    ### Start!

    Try to start your brand new Squid with `service squid start`

    ## Going further

    ### Customize configuration

    Squid offers some interesting customisation options you should have a look at. Every of this suggestions implies a modification of the file located at `/etc/squid/squid.conf`.

    #### Listening ports

    With the provided configuration, your proxy will be listening on HTTP port 3128, which is the squid default.
    You can change it to any available port that suits you with:

    ```
    http_port 3128
    ```

    ### Enable authentication

    Your proxy will respond to any request. If you want to limit its accessibility to a set of users, you may want to enable authentication, by uncommenting the following section:

    ```
    #acl Users proxy_auth REQUIRED
    #http_access allow Users
    ```

    This authentication relies on a password file you will find at `/etc/squid/users.pwd`. A sample user is included, defined with the following identification:
    - username : `proxy`
    - password : `proxy`

    This user file may be modified following the next section instructions.

    ### Manage user accounts

    Using the command [htpasswd](https://httpd.apache.org/docs/current/programs/htpasswd.html), you will be able to manage the IDs of the users able to use the proxy.

    To add or update a user:
    ```
    htpasswd -bd /etc/squid/users.pwd johndoe mypw
    ```

    To remove a user:
    ```
    htpasswd -D /etc/squid/users.pwd johndoe
    ```

    **NOTE:** Provided authentication relies on CRYPT algorithm. Information defined in `users.pwd` must respect that, meaning that passwords can only be up to 8 characters.
  12. e7d revised this gist Jan 4, 2017. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -27,7 +27,10 @@
    ### Squid installation script

    `wget -qO- https://gist.github.com/e7d/1f784339df82c57a43bf/raw/squid-install.sh | sh`
    ```
    wget -qO- https://gist.github.com/e7d/1f784339df82c57a43bf/raw/squid-install.sh | sh
    ```

    ## Manual install

  13. e7d revised this gist Jan 4, 2017. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -73,7 +73,7 @@ cd squid-3.5.23
    --with-default-user=proxy \
    --with-logdir=/var/log/squid \
    --with-pidfile=/var/run/squid.pid
    make
    make -j$(nproc)
    make install
    ```
    2 changes: 1 addition & 1 deletion squid-install.sh
    Original file line number Diff line number Diff line change
    @@ -36,7 +36,7 @@ echo "Build binaries"
    --with-default-user=proxy \
    --with-logdir=/var/log/squid \
    --with-pidfile=/var/run/squid.pid
    make
    make -j$(nproc)

    echo "Stop running service"
    service squid stop
  14. e7d revised this gist Jan 4, 2017. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions squid.conf
    Original file line number Diff line number Diff line change
    @@ -59,10 +59,10 @@ auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/users.pwd
    auth_param basic children 5
    auth_param basic realm Proxy
    auth_param basic credentialsttl 2 hours
    auth_param basic casesensitive off
    auth_param basic casesensitive on

    #acl users proxy_auth REQUIRED
    #http_access allow users
    #acl Users proxy_auth REQUIRED
    #http_access allow Users

    # Access Restrictions

  15. e7d revised this gist Jan 4, 2017. 1 changed file with 1 addition and 7 deletions.
    8 changes: 1 addition & 7 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -27,13 +27,7 @@
    ### Squid installation script

    ```
    cd ~
    wget --no-check-certificate -O squid-install.sh https://gist.github.com/e7d/1f784339df82c57a43bf/raw/squid-install.sh \
    && chmod +x squid-install.sh \
    && ./squid-install.sh
    ```
    `wget -qO- https://gist.github.com/e7d/1f784339df82c57a43bf/raw/squid-install.sh | sh`

    ## Manual install

  16. e7d revised this gist Jan 4, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Build a Squid transparent proxy from source code
    # Build a Squid anonymous proxy from source code

    > Please note that this whole manual refers to the version **3.5.23** of Squid. You probably would have to adapt some commands to the version you will actually download.
  17. e7d revised this gist Jan 4, 2017. 2 changed files with 5 additions and 5 deletions.
    8 changes: 4 additions & 4 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Build a Squid transparent proxy from source code

    > Please note that this whole manual refers to the version **3.5.15** of Squid. You probably would have to adapt some commands to the version you will actually download.
    > Please note that this whole manual refers to the version **3.5.23** of Squid. You probably would have to adapt some commands to the version you will actually download.
    ## Table of contents

    @@ -61,9 +61,9 @@ aptitude build-dep squid3

    ```
    cd /usr/src
    wget http://www.squid-cache.org/Versions/v3/3.5/squid-3.5.15.tar.gz
    tar zxvf squid-3.5.15.tar.gz
    cd squid-3.5.15
    wget http://www.squid-cache.org/Versions/v3/3.5/squid-3.5.23.tar.gz
    tar zxvf squid-3.5.23.tar.gz
    cd squid-3.5.23
    ```

    2 changes: 1 addition & 1 deletion squid-install.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    #!/bin/sh

    SQUID_VERSION=3.5.15
    SQUID_VERSION=3.5.23

    if [ "$(id -u)" != "0" ]; then
    echo "This script must be run as root" 1>&2
  18. e7d revised this gist Mar 18, 2016. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -42,10 +42,10 @@ wget --no-check-certificate -O squid-install.sh https://gist.githubusercontent.c
    Edit your `/etc/apt/sources.list` file, and check that you have `deb-src` entries like the following sample.

    ```
    deb http://ftp.us.debian.org/debian wheezy main
    deb-src http://ftp.us.debian.org/debian wheezy main
    deb http://security.debian.org/ wheezy/updates main
    deb-src http://security.debian.org/ wheezy/updates main
    deb http://httpredir.debian.org/debian stable main
    deb-src http://httpredir.debian.org/debian stable main
    deb http://security.debian.org/ stable/updates main
    deb-src http://security.debian.org/ stable/updates main
    ```

  19. e7d revised this gist Mar 18, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions squid-install.sh
    Original file line number Diff line number Diff line change
    @@ -8,8 +8,8 @@ if [ "$(id -u)" != "0" ]; then
    fi

    echo "Add repositories to Aptitude"
    echo "deb http://ftp.debian.org/debian stable main" >> /etc/apt/sources.list.d/squid.list
    echo "deb-src http://ftp.debian.org/debian stable main" >> /etc/apt/sources.list.d/squid.list
    echo "deb http://httpredir.debian.org/debian stable main" > /etc/apt/sources.list.d/squid.list
    echo "deb-src http://httpredir.debian.org/debian stable main" >> /etc/apt/sources.list.d/squid.list
    echo "deb http://security.debian.org/ stable/updates main" >> /etc/apt/sources.list.d/squid.list
    echo "deb-src http://security.debian.org/ stable/updates main" >> /etc/apt/sources.list.d/squid.list

  20. e7d revised this gist Mar 9, 2016. 2 changed files with 5 additions and 5 deletions.
    8 changes: 4 additions & 4 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Build a Squid transparent proxy from source code

    > Please note that this whole manual refers to the version **3.5.11** of Squid. You probably would have to adapt some commands to the version you will actually download.
    > Please note that this whole manual refers to the version **3.5.15** of Squid. You probably would have to adapt some commands to the version you will actually download.
    ## Table of contents

    @@ -61,9 +61,9 @@ aptitude build-dep squid3

    ```
    cd /usr/src
    wget http://www.squid-cache.org/Versions/v3/3.5/squid-3.5.5.tar.gz
    tar zxvf squid-3.5.5.tar.gz
    cd squid-3.5.5
    wget http://www.squid-cache.org/Versions/v3/3.5/squid-3.5.15.tar.gz
    tar zxvf squid-3.5.15.tar.gz
    cd squid-3.5.15
    ```

    2 changes: 1 addition & 1 deletion squid-install.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    #!/bin/sh

    SQUID_VERSION=3.5.11
    SQUID_VERSION=3.5.15

    if [ "$(id -u)" != "0" ]; then
    echo "This script must be run as root" 1>&2
  21. e7d revised this gist Nov 2, 2015. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Build a Squid transparent proxy from source code

    > Please note that this whole manual refers to the version **3.5.5** of Squid. You probably would have to adapt some commands to the version you will actually download.
    > Please note that this whole manual refers to the version **3.5.11** of Squid. You probably would have to adapt some commands to the version you will actually download.
    ## Table of contents

    2 changes: 1 addition & 1 deletion squid-install.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    #!/bin/sh

    SQUID_VERSION=3.5.10
    SQUID_VERSION=3.5.11

    if [ "$(id -u)" != "0" ]; then
    echo "This script must be run as root" 1>&2
  22. e7d revised this gist Oct 7, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion squid-install.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    #!/bin/sh

    SQUID_VERSION=3.5.5
    SQUID_VERSION=3.5.10

    if [ "$(id -u)" != "0" ]; then
    echo "This script must be run as root" 1>&2
  23. e7d revised this gist Jun 15, 2015. 1 changed file with 7 additions and 9 deletions.
    16 changes: 7 additions & 9 deletions squid.conf
    Original file line number Diff line number Diff line change
    @@ -7,9 +7,8 @@ via off

    # Log

    logformat squid %tg.%03tu %6tr %>a %Ss/%03>Hs %<st %rm %ru %[un %Sh/%<a %mt
    access_log /var/log/squid/access.log squid
    logformat languagelog %{Accept-Language}>h
    access_log /var/log/squid/languages.log languagelog

    # Cache

    @@ -54,16 +53,15 @@ acl CONNECT method CONNECT
    # Uncomment the following lines to enable file based authentication BUT:
    # The following section requires to have squid libs installed, especially `nsca_auth`, to be working.
    # This sections uses a Htpasswd file named `users.pwd` file to store eligible accounts.
    # You can generate yours using the htpasswd command from "apache-utils" aptitude package, using "-d" flag to use system CRYPT.
    # You can generate yours using the htpasswd command from "apache2-utils" aptitude package, using "-d" flag to use system CRYPT.

    #auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/users.pwd
    #auth_param basic children 5
    #auth_param basic realm Proxy
    #auth_param basic credentialsttl 2 hours
    #auth_param basic casesensitive off
    auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/users.pwd
    auth_param basic children 5
    auth_param basic realm Proxy
    auth_param basic credentialsttl 2 hours
    auth_param basic casesensitive off

    #acl users proxy_auth REQUIRED

    #http_access allow users

    # Access Restrictions
  24. e7d revised this gist May 29, 2015. 1 changed file with 3 additions and 4 deletions.
    7 changes: 3 additions & 4 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -46,6 +46,7 @@ deb http://ftp.us.debian.org/debian wheezy main
    deb-src http://ftp.us.debian.org/debian wheezy main
    deb http://security.debian.org/ wheezy/updates main
    deb-src http://security.debian.org/ wheezy/updates main
    ```

    Build Squid 3 dependencies
    @@ -114,10 +115,8 @@ wget --no-check-certificate -O /etc/squid/users.pwd https://gist.githubuserconte
    ```

    > To enable this authentication, you will have to uncomment the **Authentication** section of the sample `squid.conf` configuration file.
    > You can create your users entries using the [htpasswd](http://httpd.apache.org/docs/current/programs/htpasswd.html) tool from Apache. i.e. `htpasswd -db /etc/squid/users.pwd jones Pwd4Steve` will create a user "jones" with the password "Pwd4Steve" inside the "/etc/squid/users.pwd" file.
    > You can also directly use the [users.pwd](https://gist.github.com/e7d/1f784339df82c57a43bf/raw/users.pwd) sample, providing you a basic user named *proxy*, using also *proxy* as password.
    > You can create your users entries using the [htpasswd](http://httpd.apache.org/docs/current/programs/htpasswd.html) tool from Apache. i.e. `htpasswd -db /etc/squid/users.pwd jones fx5rm31s` will create a user "jones" with the password "fx5rm31s" inside the "/etc/squid/users.pwd" file.
    > You can directly use the [users.pwd](https://gist.github.com/e7d/1f784339df82c57a43bf/raw/users.pwd) sample, providing you a basic user named *proxy*, using also *proxy* as password.
    ### Build service runtime

  25. e7d revised this gist May 29, 2015. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -114,7 +114,9 @@ wget --no-check-certificate -O /etc/squid/users.pwd https://gist.githubuserconte
    ```

    > To enable this authentication, you will have to uncomment the **Authentication** section of the sample `squid.conf` configuration file.
    > You can create your users entries using the [htpasswd](http://httpd.apache.org/docs/current/programs/htpasswd.html) tool from Apache. i.e. `htpasswd -db /etc/squid/users.pwd jones Pwd4Steve` will create a user "jones" with the password "Pwd4Steve" inside the "/etc/squid/users.pwd" file.
    > You can also directly use the [users.pwd](https://gist.github.com/e7d/1f784339df82c57a43bf/raw/users.pwd) sample, providing you a basic user named *proxy*, using also *proxy* as password.
    ### Build service runtime
  26. e7d revised this gist May 29, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -114,7 +114,7 @@ wget --no-check-certificate -O /etc/squid/users.pwd https://gist.githubuserconte
    ```

    > To enable this authentication, you will have to uncomment the **Authentication** section of the sample `squid.conf` configuration file.
    > You can create your users entries on the [Htpasswd Generator](http://www.htaccesstools.com/htpasswd-generator/) website.
    > You can create your users entries using the [htpasswd](http://httpd.apache.org/docs/current/programs/htpasswd.html) tool from Apache. i.e. `htpasswd -db /etc/squid/users.pwd jones Pwd4Steve` will create a user "jones" with the password "Pwd4Steve" inside the "/etc/squid/users.pwd" file.
    > You can also directly use the [users.pwd](https://gist.github.com/e7d/1f784339df82c57a43bf/raw/users.pwd) sample, providing you a basic user named *proxy*, using also *proxy* as password.
    ### Build service runtime
  27. e7d revised this gist May 29, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions users.pwd
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    proxy:V3SumwH0Poabk
  28. e7d revised this gist May 29, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion squid-install.sh
    Original file line number Diff line number Diff line change
    @@ -17,8 +17,8 @@ echo "Update packages list"
    apt-get update

    echo "Build dependencies"
    apt-get -y install build-essential libssl-dev apache2-utils
    apt-get -y build-dep squid3
    apt-get install apache-utils

    echo "Download source code"
    cd /usr/src
  29. e7d revised this gist May 29, 2015. 2 changed files with 5 additions and 5 deletions.
    8 changes: 4 additions & 4 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Build a Squid transparent proxy from source code

    > Please note that this whole manual refers to the version **3.5.4** of Squid. You probably would have to adapt some commands to the version you will actually download.
    > Please note that this whole manual refers to the version **3.5.5** of Squid. You probably would have to adapt some commands to the version you will actually download.
    ## Table of contents

    @@ -60,9 +60,9 @@ aptitude build-dep squid3

    ```
    cd /usr/src
    wget http://www.squid-cache.org/Versions/v3/3.5/squid-3.5.4.tar.gz
    tar zxvf squid-3.5.4.tar.gz
    cd squid-3.5.4
    wget http://www.squid-cache.org/Versions/v3/3.5/squid-3.5.5.tar.gz
    tar zxvf squid-3.5.5.tar.gz
    cd squid-3.5.5
    ```

    2 changes: 1 addition & 1 deletion squid-install.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    #!/bin/sh

    SQUID_VERSION=3.5.4
    SQUID_VERSION=3.5.5

    if [ "$(id -u)" != "0" ]; then
    echo "This script must be run as root" 1>&2
  30. e7d revised this gist May 29, 2015. 3 changed files with 4 additions and 3 deletions.
    3 changes: 2 additions & 1 deletion squid-install.sh
    Original file line number Diff line number Diff line change
    @@ -18,6 +18,7 @@ apt-get update

    echo "Build dependencies"
    apt-get -y build-dep squid3
    apt-get install apache-utils

    echo "Download source code"
    cd /usr/src
    @@ -56,7 +57,7 @@ wget --no-check-certificate -O /etc/squid/squid.conf https://gist.githubusercont

    echo "Create users database sample"
    rm -fr /etc/squid/users.pwd
    wget --no-check-certificate -O /etc/squid/users.pwd https://gist.github.com/e7d/1f784339df82c57a43bf/raw/users.pwd
    htpasswd -c -b -d /etc/squid/users.pwd proxy proxy

    echo "Create service executable file"
    wget --no-check-certificate -O /etc/init.d/squid https://gist.github.com/e7d/1f784339df82c57a43bf/raw/squid.sh
    3 changes: 2 additions & 1 deletion squid.conf
    Original file line number Diff line number Diff line change
    @@ -54,12 +54,13 @@ acl CONNECT method CONNECT
    # Uncomment the following lines to enable file based authentication BUT:
    # The following section requires to have squid libs installed, especially `nsca_auth`, to be working.
    # This sections uses a Htpasswd file named `users.pwd` file to store eligible accounts.
    # You can generate yours at http://www.htaccesstools.com/htpasswd-generator/
    # You can generate yours using the htpasswd command from "apache-utils" aptitude package, using "-d" flag to use system CRYPT.

    #auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/users.pwd
    #auth_param basic children 5
    #auth_param basic realm Proxy
    #auth_param basic credentialsttl 2 hours
    #auth_param basic casesensitive off

    #acl users proxy_auth REQUIRED

    1 change: 0 additions & 1 deletion users.pwd
    Original file line number Diff line number Diff line change
    @@ -1 +0,0 @@
    proxy:$apr1$p1eaNfR4$bNKG9V8VU9dipu34a9j3V1