# 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
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.devops.buzz/public/squid/setup-server.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
