顯示具有 squid 標籤的文章。 顯示所有文章
顯示具有 squid 標籤的文章。 顯示所有文章

2019年6月16日

CentOS 6.10 安裝 Proxy 代理伺服器 squid 步驟紀錄

# yum install -y squid httpd-tools
# vi /etc/squid/squid.conf
   visible_hostname your.host.name
   auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/passwd (用 #rpm -ql squid | grep ncsa_auth 找出路徑 )

   acl kkkkk src 123.456.789.0/24
   acl all_networks src all
   acl password proxy_auth REQUIRED

   http_access allow kkkkk
   http_access allow password
   http_access allow all_networks

# htpasswd -c /etc/squid/passwd user_name
# squid -z
# /etc/init.d/squid restart
# crontab -e
   0 0 * * * /etc/init.d/squid stop;echo " " > /var/spool/squid/swap.state;/etc/init.d/squid start

2018年6月23日

在 CentOS 7 設定 加密代理伺服器 squid ( ncsa_auth )

squid 3.5 使用的加密套件名稱已經改為 basic_ncsa_auth ( squid 2.x 以前是 ncsa_auth )

# touch /etc/squid/passwd
# chown squid /etc/squid/passwd
# htpasswd -d /etc/squid/passwd lsps
# vi /etc/squid/squid.conf
auth_param basic program /usr/lib64/squid/basic_ncsa_auth /etc/squid/passwd
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off
#下面這行放在 acl 最前面
acl ncsa_users proxy_auth REQUIRED
http_access allow ncsa_users
# systemctl restart squid

2018年5月22日

CentOS 7 快速安裝 squid 手記

# yum install squid
# vi /etc/squid/squid.conf
acl Your_Name src 123.123.123.0/24
http_access allow Your_Name
http_port Your_port_NO
cache_dir ufs /var/spool/squid 100 16 256

# squid -z
# systemctl start squid

2017年8月30日

squid 伺服器設定 cache_dir

# Uncomment and adjust the following to add a disk cache directory.   
#cache_dir ufs /var/spool/squid 100 16 256                                         
cache_dir ufs /var/spool/squid 1000 16 256                                         

第一個數字參數不能小於cache_mem設置的大小,所以就設定1000了。
不然會出現 「WARNING cache_mem is larger than total disk cache space!」的警告訊息。