squid設置

首先,在終端中輸入htpasswd命令,若是沒有,請按提示安裝所需的包。 下載squid-2.5.STABLE1.tar.gz tar -xvf squid-2.5.STABLE1.tar.gz cd squid-2.5.STABLE1 sudo ./configure --enable-auth="basic" --enable-baisc-auth-helpers="NCSA" sudo make cd helpers/basic_auth/NCSA sudo make sudo cp ncsa_auth /usr/bin ######################################################   至此已存放好ncsa_auth sudo apt-get install squid                  ##########   安裝squid  已經下載了一個包,爲何還要這樣安裝呢?由於我用下載的                                             ##########                              包配置的時候問題,沒有成功配置。 htpasswd -c /etc/squid/password guest       #########    產生名爲password的文件,並建立用戶guest,而後會提示輸入密碼。 htpasswd /etc/squid/password admin          #########    注意,命令中沒有-c。由於password文件已建立,不用再建立。                                             #########    若是要添加其它用戶,與此行命令類似 #################################################    至此,已準備好 ncsa_auth 和 password 文件 sudo cp squid.conf squid.conf~ sudo gedit /etc/squid/squid.conf 用如下內容覆蓋原文 auth_param basic program /usr/bin/ncsa_auth /etc/squid/password auth_param basic children 5 auth_param basic realm Squid proxy-caching web server acl localnet src 10.3.6.112/32 acl password proxy_auth REQUIRED acl all src all http_access allow localnet http_access allow password http_access deny all http_port 3128
相關文章
相關標籤/搜索