差異處
這裏顯示兩個版本的差異處。
| 兩邊的前次修訂版 前次修改 下次修改 | 前次修改 | ||
| squid [2017/01/07 16:30] – jz | squid [2018/12/29 21:39] (目前版本) – jz | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| - | ====== | + | ====== |
| - | ===== install | + | ===== Install |
| - | < | + | < |
| pkg install squid | pkg install squid | ||
| + | pkg install htdigest | ||
| sysrc squid_enable=" | sysrc squid_enable=" | ||
| </ | </ | ||
| - | ===== config | + | ===== Auth ===== |
| + | There are two ways to specify the password auth, '' | ||
| + | |||
| + | **htdigest** | ||
| ''/ | ''/ | ||
| + | < | ||
| + | auth_param basic program / | ||
| + | auth_param basic realm proxy | ||
| + | auth_param basic casesensitive | ||
| + | </ | ||
| + | <code bash> | ||
| + | apache-htdigest -c / | ||
| + | # or htdigest if apache-htdigest is not found | ||
| + | </ | ||
| + | |||
| + | <code bash> | ||
| + | php -a | ||
| + | echo ' | ||
| + | </ | ||
| + | |||
| + | **htpasswd** | ||
| + | |||
| + | ''/ | ||
| < | < | ||
| auth_param digest realm proxy | auth_param digest realm proxy | ||
| auth_param digest program / | auth_param digest program / | ||
| + | </ | ||
| + | |||
| + | <code bash> | ||
| + | htpasswd -c / | ||
| + | </ | ||
| + | |||
| + | ===== ACL ===== | ||
| + | ''/ | ||
| + | < | ||
| acl users proxy_auth REQUIRED | acl users proxy_auth REQUIRED | ||
| + | acl ncku src 140.116.0.0/ | ||
| + | http_access deny !ncku | ||
| http_access allow users | http_access allow users | ||
| - | |||
| http_port 3128 | http_port 3128 | ||
| + | </ | ||
| - | # Leave coredumps in the first cache dir | + | ===== Check config ===== |
| - | coredump_dir / | + | |
| - | # | + | <code bash> |
| - | # Add any of your own refresh_pattern entries above these. | + | squid -f /usr/local/ |
| - | # | + | |
| - | refresh_pattern ^ftp: | + | |
| - | refresh_pattern ^gopher: | + | |
| - | refresh_pattern | + | |
| - | refresh_pattern | + | |
| </ | </ | ||
| - | <code sh> | + | ===== Start service ===== |
| - | apache-htdigest -c / | + | |
| - | # or htdigest if apache-htdigest is not found | + | |
| - | </ | + | |
| - | ===== check config ===== | + | < |
| - | + | service | |
| - | < | + | |
| - | squid -f / | + | |
| </ | </ | ||
| + | |||