linux下配置squid 代理

网友投稿 1151 2022-08-25

linux下配置squid 代理

linux下配置squid 代理

安装squid

1、官方网站为 ​​~]# yum install -y squid

Installed:

squid-7:4.15-1.module_el8.5.0+860+303ccf92.x86_64

[root@VM-12-13-centos ~]# squid -v

Squid Cache: Version 4.15

配置文件路径:

vi /etc/squid/squid.conf

根据以下内容做修改

# Only allow cachemgr access from localhost

allow localhost manager

# deny manager

# We strongly recommend the following be uncommented to protect innocent

# web applications running on the proxy server who think the only

# one who can access services on "localhost" is a local user

# deny to_localhost

#

# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS

#

# Example rule allowing access from your local networks.

# Adapt localnet in the ACL section to list your (internal) IP networks

# from where browsing should be allowed

allow localnet

allow localhost

# And finally deny all other access to this proxy

# deny all

# Squid normally listens to port 3128

allow all             #放在deny all 之前,允许任意客户机使用代理服务,控制规则自上而下匹配

deny all

3128                     #用来指定代理服务监听的地址和端口(默认的端口号为3128)

2、启动squid并设置开机启动

[root@VM-12-13-centos ~]# systemctl enable squid

Created symlink /etc/systemd/system/multi-user.target.wants/squid.service → /usr/lib/systemd/system/squid.service

[root@VM-12-13-centos ~]# systemctl start squid

[root@VM-12-13-centos ~]# systemctl status squid

● squid.service - Squid caching proxy

Loaded: loaded (/usr/lib/systemd/system/squid.service; disabled; vendor preset: disabled)

Active: active (running)

客户端应用使用代理

1、向日葵设置代理测试使用

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:html初学(三)
下一篇:Android 开发有哪些新技术出现?
相关文章

 发表评论

暂时没有评论,来抢沙发吧~