# Setup server

## Install squid

```bash
apt update
apt install squid squid-common
```

## Setup squid

### Allow all (not recommended for production)

Edit config file:

```bash
nano /etc/squid3/squid.conf
```

Find the following line:

```
http_access deny all
```

**BEFORE** this line add:

```
acl all src 0.0.0.0/0
http_access allow all
```

### Basic auth

Edit config file:

```bash
nano /etc/squid3/squid.conf
```

Find the following line:

```
http_access deny all
```

**BEFORE** this line add:

```
acl all src 0.0.0.0/0
auth_param basic program /usr/lib/squid3/basic_ncsa_auth /etc/squid3/passwords
auth_param basic realm proxy
acl authenticated proxy_auth REQUIRED
http_access allow authenticated
```

#### Add user

Run:

```
htpasswd -c /etc/squid3/passwords YOUR-USER-NAME-HERE
```

Input your password twice.

#### Setup client&#x20;

```
export http_proxy="http://USER:PASSWORD@PROXY-HOST:3128"
export https_proxy="http://USER:PASSWORD@PROXY-HOST:3128"
export ftp_proxy="http://USER:PASSWORD@PROXY-HOST:3128"
export no_proxy="localhost,127.0.0.1,::1"
curl http://www.google.com
```
