Build Squid proxy server and enable simple authentication

Source: Internet
Author: User
Tags squid proxy

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


    1. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.