You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/nginx-one/agent/configure-instance-reporting/connect-using-squid.md
+174-2Lines changed: 174 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,147 @@ Ensure you have the following:
17
17
18
18
## Configure Squid
19
19
20
-
TBD
20
+
### Install Squid
21
+
22
+
{{<tabsname="Install_Squid">}}
23
+
{{%tab name="Mac OS"%}}
24
+
25
+
1. Open a terminal window.
26
+
1. Install Squid using Homebrew:
27
+
28
+
```sh
29
+
brew install squid
30
+
```
31
+
1. Start the Squid service:
32
+
33
+
```sh
34
+
brew services start squid
35
+
```
36
+
---
37
+
38
+
{{%/tab%}}
39
+
{{%tab name="Ubuntu (including running it under WSL)"%}}
40
+
41
+
Run the following commands as a superuser:
42
+
43
+
1. Open a terminal window.
44
+
1. Update the package list:
45
+
```sh
46
+
sudo apt-get update
47
+
```
48
+
1. Install Squid:
49
+
```sh
50
+
sudo apt-get install squid -y
51
+
```
52
+
1. Start the Squid service:
53
+
```sh
54
+
sudo systemctl start squid
55
+
```
56
+
---
57
+
58
+
{{%/tab%}}
59
+
{{</tabs>}}
60
+
61
+
62
+
### Configure Squid
63
+
64
+
Follow the steps below to configure Squid with basic authentication.
65
+
66
+
{{<tabsname="Configure_Squid">}}
67
+
{{%tab name="Mac OS"%}}
68
+
69
+
1. Set up an HTTP Proxy with Basic Authentication. This setup requires users to provide a username and password. Run the
70
+
following commands as a superuser:
71
+
72
+
```sh
73
+
htpasswd -c /usr/local/squid/passwd your_user # Create a user
74
+
```
75
+
76
+
- You will be prompted to enter and confirm a password for `your_user`.
77
+
78
+
1. Locate the Squid configuration file:
79
+
- Run `squid -v` to find the configuration file path. Look for the `--sysconfdir` flag (usually `/usr/local/etc/squid/squid.conf` or `/opt/homebrew/etc/squid.conf` on Mac OS).
80
+
81
+
1. Find the path to your basic_ncsa_auth program:
82
+
- On Mac OS, it is usually be located at `/opt/homebrew/Cellar/squid/7.1/libexec/basic_ncsa_auth`. You can get the version number from the `squid -v` command output.
83
+
84
+
1. Open the Squid configuration file with a text editor (you might need superuser privileges):
85
+
86
+
```sh
87
+
sudo nano <path to config file>/squid.conf
88
+
```
89
+
90
+
1. Add or modify the following lines (usually at the top of the file) to configure the proxy settings:
91
+
92
+
```conf
93
+
auth_param basic program <path_to_basic_ncsa_auth>/basic_ncsa_auth /usr/local/etc/squid/passwd auth_param basic realm Squid proxy-caching web server acl authenticated proxy_auth REQUIRED
94
+
```
95
+
96
+
1. In the same configuration file, find the line that starts with `http_access deny all` and add the `http_access allow authenticated` line above it. It should look like this:
97
+
98
+
```conf
99
+
http_access allow authenticated
100
+
http_access deny all
101
+
```
102
+
103
+
1. Save the changes and exit the text editor.
104
+
1. Restart the Squid service to apply the changes:
105
+
106
+
```sh
107
+
brew services restart squid
108
+
```
109
+
110
+
---
111
+
112
+
{{%/tab%}}
113
+
{{%tab name="Ubuntu"%}}
114
+
115
+
1. Set up an HTTP Proxy with Basic Authentication. This setup requires users to provide a username and password. Run the
htpasswd -c /usr/local/squid/passwd your_user # Create a user
121
+
```
122
+
123
+
- You will be prompted to enter and confirm a password for `your_user`.
124
+
125
+
1. Locate the Squid configuration file:
126
+
- Run `squid -v` to find the configuration file path. Look for the `--sysconfdir` flag (usually `/etc/squid/squid.conf` on Ubuntu).
127
+
128
+
1. Find the path to your basic_ncsa_auth program:
129
+
- On Ubuntu, it is usually located at `/usr/lib/squid/basic_ncsa_auth`.
130
+
131
+
1. Open the Squid configuration file with a text editor (you might need superuser privileges):
132
+
133
+
```sh
134
+
sudo nano <path to config file>/squid.conf
135
+
```
136
+
137
+
1. Add or modify the following lines (usually at the top of the file) to configure the proxy settings:
138
+
139
+
```conf
140
+
auth_param basic program <path_to_basic_ncsa_auth>/basic_ncsa_auth /usr/local/etc/squid/passwd auth_param basic realm Squid proxy-caching web server acl authenticated proxy_auth REQUIRED
141
+
```
142
+
143
+
1. In the same configuration file, find the line that starts with `http_access deny all` and add the `http_access allow authenticated` line above it. It should look like this:
144
+
145
+
```conf
146
+
http_access allow authenticated
147
+
http_access deny all
148
+
```
149
+
150
+
1. Save the changes and exit the text editor.
151
+
1. Restart the Squid service to apply the changes:
152
+
153
+
```sh
154
+
sudo systemctl restart squid
155
+
```
156
+
157
+
---
158
+
159
+
{{%/tab%}}
160
+
{{</tabs>}}
21
161
22
162
## NGINX Agent Proxy configuration
23
163
@@ -97,4 +237,36 @@ To set proxy authentication in a containerized environment:
97
237
98
238
## Validate connectivity between NGINX Agent, Squid, and NGINX One Console
99
239
100
-
TBD
240
+
To test the connectivity between NGINX Agent, Squid, and NGINX One Console, you can use the `curl`command with the proxy settings.
241
+
242
+
1. Open a secure connection to your instance using SSH and log in.
243
+
1. Run the following `curl`command to test the connection:
0 commit comments