The Squid software required to install the proxy
Yum-y Install Squid
Second, the configuration file location
/etc/squid/squid.conf
#默认配置文件是可以代理所有私网地址的, add your own if you have additional addresses
Third, turn on the cache function
Cache_dir UFS/VAR/SPOOL/SQUID 100 16 256
#默认改行是被注释掉的, if you need to turn on the cache, remove the comment.
Four, open the authentication function
Software Installation
[Email protected] ~]# RPM-QL Squid | grep NCSA
/usr/lib64/squid/ncsa_auth #查看是否存在验证文件, install squid automatically when installed.
/usr/share/man/man8/ncsa_auth.8.gz
[Email protected] ~]# yum-y install httpd #安装apache软件
[Email protected] ~]# RPM-QL httpd | grep htpasswd
/USR/BIN/HTPASSWD #需要这个账号密码建立命令
/usr/share/augeas/lenses/dist/htpasswd.aug
2. Configuration files
Vim/etc/squid/squid.conf
Add user authentication
#用户认证需要添加
Auth_param Basic PROGRAM/USR/LIB64/SQUID/NCSA_AUTH/ETC/SQUID/PASSWD
Auth_param Basic Children 5
Auth_param Basic Credentialsttl 2 hours
Auth_param Basic Realm example.com ' s Squid proxy-caching
ACL Auth_User Proxy_auth REQUIRED
Http_access Allow Auth_User
Comments:
First line: Select the authentication method for basic, authentication program path and password file path.
Second line: Number of processes that certify the program
Third line: Certification validity time
Line four: Authentication domain content, the above defined web browsing needs to enter the user password
Five, line six: Set user access to allow authentication
Generate a password file
The/etc/squid/passwd file in the first line can be generated using the following method and run on the Apache-mounted machine
Htpasswd-c/etc/squid/passwd Auth_User
The above Auth_User are replaced by certified users such as Zhangsan
Password
Five, restart the service
[Email protected] ~]# Service squid restart
This article from "Write something?" "Blog, be sure to keep this provenance http://lipenglong.blog.51cto.com/5309038/1891557
Build Squid proxy server and enable simple authentication