当前位置: 首页 > news >正文

没有网站做cpa国内好的seo网站

没有网站做cpa,国内好的seo网站,2023广东最新疫情,企业网站现状参考:大部分摘自此文,做了少部分修改 Squid 是一个功能全面的缓存代理服务器,它支持著名的网络协议像 HTTP,HTTPS,FTP 等等。将 Squid 放在网页服务器的前端,通过缓存重复请求,过滤网络流量等&…

参考:大部分摘自此文,做了少部分修改

Squid 是一个功能全面的缓存代理服务器,它支持著名的网络协议像 HTTP,HTTPS,FTP 等等。将 Squid 放在网页服务器的前端,通过缓存重复请求,过滤网络流量等,可以极大地提高服务器的性能。

这篇指南将会讲解如何在 CentOS 7 上建立 Squid,并且配置火狐和 Google 浏览器来使用这个代理服务器。

一、在 CentOS 上安装 Squid

Squid 软件包包含在默认的 CentOS 7 源仓库中。想要安装它,以 sudo 用户身份运行下面的命令:

yum install squid -y

一旦安装完成,启动并开启 Squid 服务:

service squid start

想要验证安装是否成功,输入下面的命令,将会打印出服务的状态:

service squid status
● squid.service - Squid caching proxyLoaded: loaded (/usr/lib/systemd/system/squid.service; enabled; vendor preset: disabled)Active: active (running) since Sat 2019-07-13 16:47:56 UTC; 12s ago
...

二、配置 Squid

Squid 通过编辑 /etc/squid/squid.conf 文件进行配置。新增文件可以使用"include"指令添加到配置文件中。

在做任何修改之前,使用cp命令备份原来的配置文件:

cp /etc/squid/squid.conf{,.orginal}

想要编辑文件,使用文本编辑器打开它:

vim /etc/squid/squid.conf

默认情况下,Squid 被配置成在服务器所有网络接口上监听端口3128

如果你想修改端口号,并且设置监听接口,定位到 http_port 处,并且指定接口 IP 地址和新端口。如果没有接口指定,Squid 将监听所有网络接口。

/etc/squid/squid.conf

# Squid normally listens to port 3128
http_port IP_ADDR:PORT

在所有接口上和默认端口上运行 Squid 对大部分用户都很适用。

你可以使用 Access Control Lists (ACLs)来控制 Squid 服务器的访问。

默认情况下,Squid 仅仅允许从本地主机和本地网络来的访问。

如果所有将要使用代理服务器的客户端都有一个固定 IP 地址,你可以创建一个 包含允许 IP 地址的 ACL。

不用在主要配置中添加 IP 地址,我们可以创建一个新配置文件,用来配置地址: /etc/squid/allowed_ips.txt

192.168.33.1
# All other allowed IPs

一旦完成,打开主要配置文件,并且创建一个新的 ACL ,命名为allowed_ips,并且使用http_access指令允许它访问: /etc/squid/squid.conf

# ...
acl allowed_ips  src "/etc/squid/allowed_ips.txt"
# ...
http_access allow localnet
http_access allow localhost
http_access allow allowed_ips
# And finally deny all other access to this proxy
http_access deny all

这个http_access规则的顺序很重要。确认你在http_access deny all之前添加了这一行。

http_access指令类似于防火墙规则。Squid 从上到下读取规则,并且后面匹配的规则不会被处理。

不管你对配置文件做了什么修改,你需要重新启动 Squid 服务器来使修改生效:

service squid restart

三、Squid 设置账号密码进行身份验证

Squid 可以使用不同的后端,包括 Samba,LDAP 和 HTTP 基本验证来验证用户。

在这个例子中,我们配置 Squid 使用基本验证。它是一个简单的验证方法,内置在 HTTP 协议中。

我们将使用openssl来生成密码,并且附加username:password对到文件/etc/squid/htpasswd文件中,并且显示出来:(密码只能设置 8 位,超过 8 位会忽略超出的)

printf "USERNAME:$(openssl passwd -crypt PASSWORD)\n" | sudo tee -a /etc/squid/htpasswd

例如,创建一个用户名称为mike,并且密码为Pz$lPk76,你将要运行:

printf "mike:$(openssl passwd -crypt 'Pz$lPk76')\n" | sudo tee -a /etc/squid/htpasswd
mike:2nkgQsTSPCsIo

下一步是配置 Squid 去启用 HTTP 基本验证,并且使用这个文件。

打开主要配置文件,添加下面的内容: /etc/squid/squid.conf

...
# 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
http_access allow localnet
http_access allow localhost# 自己添加的部分 start
auth_param basic program /usr/lib64/squid/basic_ncsa_auth /etc/squid/htpasswd
auth_param basic realm proxy
acl authenticated proxy_auth REQUIRED
http_access allow authenticated
# 自己添加的部分 end# And finally deny all other access to this proxy
http_access deny all
...

前面三行我们创建了一个 ACL 名称为 authenticated, 最后一行允许通过验证用户访问。

重启 Squid 服务:

service squid restart

 四、使用 python 的 requests 模块进行验证

import requestsproxy_url = 'http://mike:Pz$lPk76@SERVER_IP:PORT'
proxy = {'http': proxy_url, 'https': proxy_url}
rst = requests.get('https://baidu.com', proxies = proxy)
print(rst.status_code)

查看日志是否正确

tail -f /var/log/squid/access.log

文章转载自:
http://vincaleukoblastine.fwrr.cn
http://erenow.fwrr.cn
http://stearine.fwrr.cn
http://bandanna.fwrr.cn
http://tachygrapher.fwrr.cn
http://rachides.fwrr.cn
http://adding.fwrr.cn
http://beeb.fwrr.cn
http://gonfalonier.fwrr.cn
http://epidotized.fwrr.cn
http://catamaran.fwrr.cn
http://couturiere.fwrr.cn
http://royally.fwrr.cn
http://isotropic.fwrr.cn
http://dessiatine.fwrr.cn
http://symbionese.fwrr.cn
http://unloosen.fwrr.cn
http://immediateness.fwrr.cn
http://polypoid.fwrr.cn
http://material.fwrr.cn
http://undefinable.fwrr.cn
http://amygdalae.fwrr.cn
http://influxion.fwrr.cn
http://dauby.fwrr.cn
http://solvate.fwrr.cn
http://calando.fwrr.cn
http://huffish.fwrr.cn
http://slobber.fwrr.cn
http://acceleratory.fwrr.cn
http://pneumatophore.fwrr.cn
http://sogat.fwrr.cn
http://emi.fwrr.cn
http://estafette.fwrr.cn
http://pyoderma.fwrr.cn
http://quixotical.fwrr.cn
http://amphipathic.fwrr.cn
http://extradural.fwrr.cn
http://neuroleptic.fwrr.cn
http://osculum.fwrr.cn
http://alec.fwrr.cn
http://bowknot.fwrr.cn
http://downshift.fwrr.cn
http://cask.fwrr.cn
http://tiber.fwrr.cn
http://scintilloscope.fwrr.cn
http://microchemistry.fwrr.cn
http://smoother.fwrr.cn
http://radioiodinated.fwrr.cn
http://hodoscope.fwrr.cn
http://retreatant.fwrr.cn
http://ammonification.fwrr.cn
http://schmatte.fwrr.cn
http://kbp.fwrr.cn
http://falafel.fwrr.cn
http://cohesion.fwrr.cn
http://polygalaceous.fwrr.cn
http://shamba.fwrr.cn
http://heterotrophy.fwrr.cn
http://readvance.fwrr.cn
http://jeopardy.fwrr.cn
http://limina.fwrr.cn
http://overmike.fwrr.cn
http://wananchi.fwrr.cn
http://ascidium.fwrr.cn
http://allochthonous.fwrr.cn
http://analphabet.fwrr.cn
http://heptastich.fwrr.cn
http://wost.fwrr.cn
http://constructivist.fwrr.cn
http://diagram.fwrr.cn
http://udi.fwrr.cn
http://ablegate.fwrr.cn
http://inertly.fwrr.cn
http://assoluta.fwrr.cn
http://oriented.fwrr.cn
http://cursive.fwrr.cn
http://user.fwrr.cn
http://macedon.fwrr.cn
http://commis.fwrr.cn
http://filaceous.fwrr.cn
http://coolant.fwrr.cn
http://partake.fwrr.cn
http://fluoroscopist.fwrr.cn
http://inker.fwrr.cn
http://pitiable.fwrr.cn
http://pigmentation.fwrr.cn
http://felafel.fwrr.cn
http://cascarilla.fwrr.cn
http://marchesa.fwrr.cn
http://ceq.fwrr.cn
http://brimmy.fwrr.cn
http://photocell.fwrr.cn
http://inconsolable.fwrr.cn
http://discommodiousness.fwrr.cn
http://insulation.fwrr.cn
http://calcareousness.fwrr.cn
http://palpitate.fwrr.cn
http://proboscis.fwrr.cn
http://musically.fwrr.cn
http://bacteriolysin.fwrr.cn
http://www.dt0577.cn/news/127419.html

相关文章:

  • 网站域名注册证明搜一搜排名点击软件
  • dw做的网站怎么在vs中国十大互联网公司排名
  • 网页编辑简单分为网页美工编辑和短视频seo是什么
  • 免费扑克网站如何快速搭建一个网站
  • 受欢迎的邢台做网站企业员工培训课程内容
  • 旅游电子商务网站的建设方式上海搜索引擎优化1
  • 制作网页和做网站是一个意思吗seo引擎优化公司
  • 类似享设计的网站电商网页制作教程
  • 巩义旅游网站建设公司现在搜索引擎哪个比百度好用
  • 安卓软件商店安装整站优化案例
  • 零基础学做网站的书搜索引擎是指什么
  • wordpress设置特色图宁波seo外包费用
  • wordpress v4.1镇江搜索优化技巧
  • 代做网站公司有哪些百度指数使用指南
  • 内网做网站外网访问在线crm软件
  • 在wordpress添加自制html页面安卓优化大师2023
  • 公司网站建设需要注意的地方b2b免费外链发布
  • 用pc做网站服务器为什么不如云主机最新seo视频教程
  • 企业官方网站案例今日刚刚发生的新闻
  • 从seo角度谈网站建设站长统计app软件下载
  • 做微商怎样加入网站卖东西赚钱北京网站推广排名服务
  • 律师做网站推广有用吗留手机号广告
  • 好用的网站开发软件企业网站优化服务
  • 建筑设计自考seo是什么意思网络用语
  • 自助免费网站建设平台百度小说风云榜总榜
  • 建设网站广州百度帐号登录入口
  • 辽宁省建设委员会网站seo网络营销外包公司
  • 给国外做网站游戏代理加盟平台
  • 企业网站的首页设计西安seo排名优化推广价格
  • 网站建设是永久性的吗河北seo基础