squid

差異處

這裏顯示兩個版本的差異處。

連向這個比對檢視

兩邊的前次修訂版 前次修改
下次修改
前次修改
squid [2017/01/07 17:03] jzsquid [2018/12/29 21:39] (目前版本) jz
行 1: 行 1:
-====== squid ======+====== Squid ======
  
-===== install =====+===== Install =====
  
 <code bash> <code bash>
 pkg install squid pkg install squid
 +pkg install htdigest
 sysrc squid_enable="YES" sysrc squid_enable="YES"
 </code> </code>
  
-===== config =====+===== Auth ===== 
 +There are two ways to specify the password auth, ''htdigest'' or ''htpasswd''
 + 
 +**htdigest**
  
 ''/usr/local/etc/squid/squid.conf'' ''/usr/local/etc/squid/squid.conf''
 +<code>
 +auth_param basic program /usr/local/libexec/squid/basic_ncsa_auth /usr/local/etc/squid/password
 +auth_param basic realm proxy
 +auth_param basic casesensitive
 +</code>
  
 +<code bash>
 +apache-htdigest -c /usr/local/etc/squid/password realm username
 +# or htdigest if apache-htdigest is not found
 +</code>
 +
 +<code bash>
 +php -a
 +echo 'user': . crypt('password', base64_encode('password'));
 +</code>
 +
 +**htpasswd**
 +
 +''/usr/local/etc/squid/squid.conf''
 <code> <code>
 auth_param digest realm proxy auth_param digest realm proxy
 auth_param digest program /usr/local/libexec/squid/digest_file_auth -c /usr/local/etc/squid/password auth_param digest program /usr/local/libexec/squid/digest_file_auth -c /usr/local/etc/squid/password
 +</code>
 +
 +<code bash>
 +htpasswd -c /usr/local/etc/squid/password username
 +</code>
 +
 +===== ACL =====
 +''/usr/local/etc/squid/squid.conf''
 +<code>
 acl users proxy_auth REQUIRED acl users proxy_auth REQUIRED
 acl ncku src 140.116.0.0/16 acl ncku src 140.116.0.0/16
行 20: 行 51:
 http_access allow users http_access allow users
 http_port 3128 http_port 3128
- 
-# Leave coredumps in the first cache dir 
-coredump_dir /var/squid/cache 
-</code> 
- 
-<code bash> 
-apache-htdigest -c /usr/local/etc/squid/passwords realm username 
-# or htdigest if apache-htdigest is not found 
 </code> </code>
  
-===== check config =====+===== Check config =====
  
 <code bash> <code bash>
行 36: 行 59:
 </code> </code>
  
-===== start service =====+===== Start service =====
  
 <code bash> <code bash>
  • squid.1483779817.txt.gz
  • 上一次變更: 2017/01/07 17:03
  • jz