squid

Nginx+Squid+php-fpm整合与配置

巧了我就是萌 提交于 2019-12-02 03:55:54
来自Kearney,转载请注明出处。 http://my.oschina.net/kear/blog/80505 很久没自己写技术类的东西了,跟大家分享一下今天整合Nginx、Squid和php-fpm的心得。 整体架构大致如下: Client -> Squid(反向代理) -> Nginx(反向代理) -> php-fpm(Server) 首现呢,版本如下: Linux: x86_64 CentOS release 6.2(Final) Squid cache: 3.1.10 Nginx: Tengine/1.4.0(nginx/1.2.3) php-fpm: PHP 5.4.6(fpm-fcgi) Zend Engine: v2.4.0 在整体架构上,传统有两种模式,一种呢,是 Client -> Squid(反向代理) -> Nginx(反向代理) -> php-fpm(Server) 另一种呢,是 Client -> Nginx(反向代理) -> Squid(反向代理) ->php-fpm(Server) 两种方法各有利弊,具体差别可以在网上查询。简单打个比方,静态图片站适合用第一种,BBS网站适合用第二种。 还有Hybrid,即混合模式,大概的样子是 Client -> Nginx(反向代理) -> Squid(反向代理) -> Nginx(中间层) ->Server

SQUID: How to disable authentication?

纵然是瞬间 提交于 2019-12-01 21:47:14
问题 I have a working Squid with authentication. How do I temporarily disable authentication? Can I just comment out the following lines below from squid.conf: acl ncsa_users proxy_auth REQUIRED And auth_param basic program /usr/lib/squid3/ncsa_auth /etc/squid3/passwd auth_param basic children 5 auth_param basic realm Squid proxy-caching web server auth_param basic credentialstt1 2 hours auth_param basic casesensitive off Or, can I just disable authentication for an acl group? Thank you in advance

高并发高流量网站架构详解

喜你入骨 提交于 2019-12-01 11:12:34
镜像网站技术 镜像网站是指将一个完全相同的站点放到几个服务器上,分别有自己的URL,这些服务器上的网站互相称为镜像网站。镜像网站和主站 并没有太大差别,或者可以视为主站的拷贝。镜像网站的好处是:如果不能对主站作正常访问(如服务器故障,网络故障或者网速太慢等),仍能通过镜像服务器获得服务。不便之处是:更新网站内容的时候,需要同时更新多个服 务器;需要用户记忆超过一个网址,或需要用户选择访问多个镜像网站中的一个,而用户选择的,不一定是最优的。在用户选择的过程中,缺乏必要的可控性。 在互联网发展的初期,互联网上的网站内容很少,而且大都是静态内容,更新频率底。但因为服务器运算能力低,带宽小,网速慢,热门网站的访问压力还是很大。 镜像网站技术在这种情况下作为一种有效解决方案,被广泛采用。随着互联网的发展,越来越多的网站使用服务器端脚本动态生成内容,同步更新越来越困难,对可 控性要求越来越高,镜像技术因为不能满足这类网站的需要,渐渐的淡出了人们的视线。但有一些大型的软件下载站,因为符合镜像网站的条件——下载的内容是静态的,更新频率较低,对带宽,速度要求又比较高, 如国外的SourceForge (http://www.SourceForge.net, 著名开源软件托管网站),Fedora(http://fedoraproject.org,RedHat 赞助的 Linux 发行版)

squid爬虫代理自动轮询转发

橙三吉。 提交于 2019-11-30 08:14:51
squid在做爬虫代理时候,我们只需要做到一个squid代理,然后对其他代理做转发轮询,如何使用squid做代理并自动转发轮询? 加上这行代码: cache_peer 120.xx.xx.32 parent 80 0 no-query weighted-round-robin weight=2 connect-fail-limit=2 allow-miss max-conn=5 name=proxy-90 注意,当 120.xx.xx.32 是相同 但是端口不同的时候,必须设置不同的name,否则会报错 cache_peer 120.xx.xx.32 specified twice 这时候及得设置不同的name 这一行的语法是这样的 cache_peer Web服务器地址 服务器类型 http端口 icp端口 [可选项], 可选项包括: proxy-only:指明从peer得到的数据在本地不进行缓存,缺省地,squid是要缓存这部分数据的; weight=n:用于你有多个peer的情况,这时如果多于一个以上的peer拥有你请求的数据时,squid通过计算每个peer的ICP响应时间来 决定其weight的值,然后squid向其中拥有最大weight的peer发出ICP请求。也即weight值越大,其优先级越高。当然你也可以手工 指定其weight值; no-query

Java 6 NTLM proxy authentication and HTTPS - has anyone got it to work?

泪湿孤枕 提交于 2019-11-30 06:27:43
问题 I have a Java application (not an applet) that needs to access a web service. Proxies for the web service have been generated with JAX-WS, and seem to work fine. In one scenario it needs to talk through a web proxy server (actually Squid 3.0), which is set to require NTLM authentication. Running on Sun's JRE 1.6.0_14, everything works fine for accessing HTTP URLs, without requiring any changes: the built-in NTLM authenticator kicks in and it all works seemlessly. If, however, the web service

How to get started with web caching, CDNs, and proxy servers? [closed]

荒凉一梦 提交于 2019-11-29 22:52:03
I'm newbie programmer building a startup that I (naturally) hope will create a large amount of traffic. I am hosting my django project on dotcloud, which is on Amazon EC2. I have some streaming media (Http though, not rmtp) so the dotcloud guys recommended I go with a CDN. I am also using Amazon S3 for storage and so decided to go with Amazon CloudFront as my CDN. The time has come where I need to turn my attention to caching and I am lost and confused. I am completely new to the concept. The entire extent of my knowledge comes from a tutorial I just read ( http://www.mnot.net/cache_docs/ )

大型网站,你是如何架构的(二)?

夙愿已清 提交于 2019-11-29 21:02:56
一、最开始的网站架构 二、应用、数据、文件分离 三、利用缓存改善网站性能 在硬件优化性能的同时,同时也通过软件进行性能优化,在大部分的网站系统中,都会利用缓存技术改善系统的性能,使用缓存主要源于热点数据的存在,大部分网站访问都遵循28原则(即80%的访问请求,最终落在20%的数据上),所以我们可以对热点数据进行缓存,减少这些数据的访问路径,提高用户体验。 四、使用集群改善应用服务器性能 应用服务器作为网站的入口,会承担大量的请求,我们往往通过应用服务器集群来分担请求数。应用服务器前面部署负载均衡服务器调度用户请求,根据分发策略将请求分发到多个应用服务器节点。 常用的负载均衡技术硬件的有F5,价格比较贵,软件的有LVS、Nginx、HAProxy。LVS是四层负载均衡,根据目标地址和端口选择内部服务器,Nginx是七层负载均衡和HAProxy支持四层、七层负载均衡,可以根据报文内容选择内部服务器,因此LVS分发路径优于Nginx和HAProxy,性能要高些,而Nginx和HAProxy则更具配置性,如可以用来做动静分离(根据请求报文特征,选择静态资源服务器还是应用服务器)。 五、数据库读写分离和分库分表 随着用户量的增加,数据库成为最大的瓶颈,改善数据库性能常用的手段是进行读写分离以及分表,读写分离顾名思义就是将数据库分为读库和写库,通过主备功能实现数据同步

Can I use Squid to upgrade client TLS connections?

被刻印的时光 ゝ 提交于 2019-11-29 07:48:51
I'm trying to allow legacy systems (CentOS 5.x) to continue making connections to services which will shortly allow only TLS v1.1 or TLS v1.2 connections (Salesforce, various payment gateways, etc.) I have installed Squid 3.5 on a Centos 7 server in a docker container, and am trying to configure squid to bump the SSL connections. My thought was that since squid acts as a MITM and opens one connection to the client and one to the target server that it would negotiate a TLS 1.2 connection to the target, while the client was connecting with SSLv3 or TLS 1.0. Am I totally off-base here, or is this

CentOS7搭建小型CDN

杀马特。学长 韩版系。学妹 提交于 2019-11-29 06:39:37
一丶试验要求 CDN基础实验2----基于nginx+squid实现缓存功能 1、搭建两个web服务,使用nginx实现。 一个做源站(然后域名为:www.cdntest.com),配置实现功能:提供可以访问的web服务; 另一个做反向代理,接收用户的请求,配置实现功能是:代理到后端的squid。 2、搭建一个squid服务,配置实现如下功能: 1)txt缓存1个月,jpg文件不缓存 2)配置回源功能,源站为后端的web服务器(nginx) 详细架构如下 图 1 二丶实验环境 图 2 三丶试验准备 centos7 软件源设置 备份原来的.repo文件 [root @localhost ~]# mkdir /etc/yum.repos.d/bacakup [root@localhost~]# mv /etc/yum.repos.d/* /etc/yum.repos.d/bacakup 下载阿里的yum源 [root@localhost~]# wget -O /etc/yum.repos.d/Centos-7.repo http://mirrors.aliyun.com/repo/Centos-7.repo [root@localhost~]# wget -O /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo

网站故障排查常用命令

怎甘沉沦 提交于 2019-11-29 00:19:26
1.查看TCP连接状态 1 2 3 4 5 6 netstat -nat |awk '{print $6}'|sort|uniq -c|sort -rn netstat -n | awk '/^tcp/ {++S[$NF]};END {for(a in S) print a, S[a]}' netstat -n | awk '/^tcp/ {++state[$NF]}; END {for(key in state) print key,"\t",state[key]}' netstat -n | awk '/^tcp/ {++arr[$NF]};END {for(k in arr) print k,"\t",arr[k]}' netstat -n |awk '/^tcp/ {print $NF}'|sort|uniq -c|sort -rn netstat -ant | awk '{print $NF}' | grep -v '[a-z]' | sort | uniq -c 2.查找请求数请20个IP(常用于查找攻来源): 1 2 netstat -anlp|grep 80|grep tcp|awk '{print $5}'|awk -F: '{print $1}'|sort|uniq -c|sort -nr|head -n20 netstat -ant |awk '/:80/