我有一个服务器运行一堆docker图像(基本上只是托pipe一堆网站) 他们都有不同的域名,都指向服务器的IP (可以说服务器IP是111.222.333.444) (我的域名是www.one.com,www.two.com,www.three.com) 目前,docker服务器将所有导出端口80映像到另一个端口上的服务器: www.one.com是港口5080 www.two.com是港口5180 www.three.com是港口5280 所以,如果我访问URL:端口,那么网站显示。 但我想使用虚拟主机,所以我可以访问每个URL的端口80,它只是redirect到相关的端口。 我知道如何用apache来做到这一点,也许可以用nginx来解决这个问题。 但我听说这是什么鱿鱼是真正的(加上apache作为虚拟主机似乎是非常重的重量) 我已经在我的ubuntu12.04服务器上安装了squid3 这是我的squid.conf到目前为止 http_port 80 accel defaultsite=www.one.com no-vhost cache_peer 127.0.0.1 parent 5080 0 no-query originserver name=YourAccelNameHere acl your_site_acl dstdomain www.one.com http_access allow your_site_acl cache_peer_access YourAccelNameHere allow your_site_acl cache_peer_access YourAccelNameHere deny all 从阅读教程,“应该”转发到本地主机上的端口5080 www.one.com(但事实并非如此) 我真的不知道鱿鱼,从我所有的谷歌search,我似乎无法find一个简单的教程做我想做的事情。 任何人都可以指向我一个很好的教程,或者甚至更好地为我提供一个squid.conf,这将做我以后? 谢谢
我已经build立了Apache和Varnish,没有涉及到特定的configuration(8080上的apache,80端口上的varnish)。 我还在光油中删除了Cookie,以确保Wordpress网站的最大caching。 该网站的工作,它加载等。 但看起来Varnish并没有caching任何东西。 当我打开Varnishstat时,我总是看到Hitrate比例为0; 还有很多“inf backend_busy”,“inf backend_reuse”等。 并没有accepted_connections。 这是一个示例: 0+00:00:00 Hitrate ratio: 0 0 0 Hitrate avg: 0.0000 0.0000 0.0000 146 0.00 inf backend_busy – Backend conn. too many 164 0.00 inf backend_reuse – Backend conn. reuses 16 0.00 inf backend_toolate – Backend conn. was closed 101 0.00 inf backend_recycle – Backend conn. recycles […]
在从caching中提取匹配的对象之前,我可以“忽略”查询stringvariables,但实际上并没有将它们从URL中移除到最终用户? 例如,所有的营销utm_source , utm_campaign , utm_*值都不会更改页面的内容,它们只是在广告系列和广告系列之间有很大差异,并且被我们所有的客户端跟踪所使用。 所以这也意味着URL不能在客户端更改,但它应该以某种方式在caching中被“标准化”。 基本上我想要所有这些… http://site.com/page/?utm_source=google http://site.com/page/?utm_source=facebook&utm_content=123 http://site.com/page/?utm_campaign=usa …所有访问HITcachinghttp://site.com/page/ 但是,这个URL会导致MISS(因为参数不是utm_ *参数) http://site.com/page/?utm_source=google&variation=5 会触发caching http://site.com/page/?variation=5 另外,请记住,用户所看到的URL必须保持不变,我不能redirect到没有params或任何类似的解决scheme。
我已经在Ubuntu 12.04 x64上安装了Varnish,并且想要在我的Magento商店中使用它。 信息: Magento 1.9.0.1 清漆caching3.0.5 Magento松节油0.6.0 我遵循了Magento松节油的安装说明 ,第2点的内容如下: 您需要使用-p esi_syntax=0x2 option启动Varnish 这是我的/etc/default/varnish文件的样子: # Configuration file for varnish START=yes NFILES=131072 MEMLOCK=82000 DAEMON_OPTS="-a :80 \ -T localhost:6082 \ -f /etc/varnish/default.vcl \ -S /etc/varnish/secret \ -s malloc,256m" \ -p esi_syntax=0x2 当做sudo service varnish restart我得到 /etc/init.d/varnish: 50: /etc/default/varnish: -p: not found /etc/init.d/varnish: 50: /etc/default/varnish: -p: not found […]
我已经在我的新的centos 6.5盒子上安装了清漆4。 我已经激活EPEL回购从http://repo.varnish-cache.org/redhat/varnish-4.0/安装清漆安装和configuration我的default.vcl后,我无法启动服务清漆,我总是得到/ var / log / audit / audit.log告诉我,selinux阻止varnishd启动: type=AVC msg=audit(1412184576.830:242): avc: denied { getattr } for pid=4623 comm="varnishd" path="/etc/hosts" dev=vda1 ino=17248 scontext=unconfined_u:system_r:varnishd_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file type=SYSCALL msg=audit(1412184576.830:242): arch=c000003e syscall=5 success=no exit=-13 a0=3 a1=7fff399e8290 a2=7fff399e8290 a3=0 items=0 ppid=4620 pid=4623 auid=0 uid=498 gid=497 euid=498 suid=498 fsuid=498 egid=497 sgid=497 fsgid=497 tty=pts0 ses=1 comm="varnishd" exe="/usr/sbin/varnishd" subj=unconfined_u:system_r:varnishd_t:s0 key=(null) 我试图使用audit2allow,但除了安装产生的模块,我得到相同的错误…
PHP-FPM 5.6和Nginx 1.6.2毫无疑问会提供最大的性能,至less在速度上是明智的。 所以,我想知道是否有任何优点/缺点添加清漆caching,以获得可能几乎没有更多的速度。 我读过很多博客,说nginx + varnish单独是有点矫枉过正,但我还没有得到一个反馈,可以certificate这一点。
我在Nginx上成功使用了Varnish 4 + Pagespeed,但是varnish没有打到caching,因为这个站点总是推送一个语言的cookie,不pipe用户是否被authentication。 这是有道理的,因为在访问期间,用户可以改变网站上的语言,并且cookie提供关于正在使用什么语言的信息。 那么,我怎样才能让这两种语言的清漆caching页面,而不是只是避免caching,然后回来? 完整的configuration在这里: # Marker to tell the VCL compiler that this VCL has been adapted to the # new 4.0 format. vcl 4.0; import std; # Block 1: Define upstream server's host and port. Set this to point to your # content server. backend default { .host = "127.0.0.1"; .port […]
我正在尝试在我的ssl enalbled网站上实施清漆。 但我正在获得循环redirect。 这就是我要去的地方 清漆在港口80听; DAEMON_OPTS="-a :80 \ -T localhost:6082 \ -f /etc/varnish/default.vcl \ -S /etc/varnish/secret \ -s malloc,256m" 和后端 backend default { .host = "127.0.0.1"; .port = "8080"; .connect_timeout = 16s; .first_byte_timeout = 96s; .between_bytes_timeout = 8s; } nginx正在8080上运行。 nginxconfiguration upstream backend { ip_hash; server 127.0.0.1:80; # IP goes here. } server { listen […]
情况: 我在一些重载的mod-php apache服务器前使用了Varnish。 当一个冷(空xcache,冷模板caching)apache启动时,服务器可能会因请求太多而过载。 问题是: 有没有办法像nginx缓慢启动( http://nginx.org/en/docs/http/ngx_http_upstream_module.html#upstream,'slow_start = time')清漆?
我在我的服务器上安装了清漆,并对清漆caching进行了以下更改。 httpd.conf更改: Listen 80 => 8080改变 NameVirtualHost从* 80 => * 8080 httpd.conf的内容 <VirtualHost *:8080> DocumentRoot /var/www/html/XYZ/ ServerName demo.example.com </VirtualHost> IN /etc/sysconfig/varnish已经做了这个改变: VARNISH_LISTEN_PORT=80 IN /etc/varnish/default.vcl :完成以下更改 backend default { .host = "127.0.0.1"; .port = "8080"; } 对于demo.example.com清漆工作正常。 但我也有example.com,example.net和example.org托pipe在同一台服务器上,我想访问没有参与清漆。 当我在httpd.conf中将PORT从80 => 8080更改时,这些站点将无法工作。 任何方式可以做什么?