我一直在努力让这个Varnish配置正确,我的服务器上有多个站点。一个是运行Zen Cart,另一个站点正在Mumpnto上运行一个带有Turpentine的开发站点。
我一直在尝试遵循以下指南: http://support.qualityunit.com/496090-How-to-install-Varnish-with-CPanel-and-CentOS-to-cache-static-content-on-server http://blog.nexcess.net/2012/05/21/installing-varnish-for-your-magento-store-on-centos-6
我已将WHM中的apache端口更改为:8080,我将以下内容放在default.vcl文件中:
backend default {
.host = "my.server.ip.addy";
.port = "8080";
}
sub vcl_recv {
if (req.url ~ "\.(png|gif|jpg|swf|css|js)$") {
return(lookup);
}
}
# strip the cookie before the image is inserted into cache.
sub vcl_fetch {
if (req.url ~ "\.(png|gif|jpg|swf|css|js)$") {
unset beresp.http.set-cookie;
}
}
...并更改了我的/ etc / sysconfig / varnish但我仍然在我的浏览器中将此页面设为www.mysite.com http://www.mysite.com/cgi-sys/defaultwebpage.cgi
我做了一个varnishstat命令,它返回了这个:
0+00:01:30
Hitrate ratio: 10 44 44
Hitrate avg: 0.4603 0.3874 0.3874
99 0.00 1.10 client_conn - Client connections accepted
139 0.00 1.54 client_req - Client requests received
43 0.00 0.48 cache_hit - Cache hits
68 0.00 0.76 cache_miss - Cache misses
5 0.00 0.06 backend_conn - Backend conn. success
91 0.00 1.01 backend_reuse - Backend conn. reuses
4 0.00 0.04 backend_toolate - Backend conn. was closed
96 0.00 1.07 backend_recycle - Backend conn. recycles
11 0.00 0.12 fetch_length - Fetch with Length
85 0.00 0.94 fetch_chunked - Fetch chunked
20 . . n_sess_mem - N struct sess_mem
3 . . n_sess - N struct sess
68 . . n_object - N struct object
70 . . n_objectcore - N struct objectcore
70 . . n_objecthead - N struct objecthead
5 . . n_waitinglist - N struct waitinglist
1 . . n_vbc - N struct vbc
100 . . n_wrk - N worker threads
100 0.00 1.11 n_wrk_create - N worker threads created
1 . . n_backend - N backends
22 . . n_lru_moved - N LRU moved objects
139 0.00 1.54 n_objwrite - Objects sent with write
99 0.00 1.10 s_sess - Total Sessions
139 0.00 1.54 s_req - Total Requests
28 0.00 0.31 s_pass - Total pass
96 0.00 1.07 s_fetch - Total fetch
32277 0.00 358.63 s_hdrbytes - Total header bytes
354234 0.00 3935.93 s_bodybytes - Total body bytes
11 0.00 0.12 sess_closed - Session Closed
132 0.00 1.47 sess_linger - Session Linger
146 0.00 1.62 sess_herd - Session herd
8705 2.00 96.72 shm_records - SHM records
939 2.00 10.43 shm_writes - SHM writes
96 0.00 1.07 backend_req - Backend requests made
1 0.00 0.01 n_vcl - N vcl total
1 0.00 0.01 n_vcl_avail - N vcl available
1 . . n_ban - N total active bans
1 . . n_ban_gone - N total gone bans
1 0.00 0.01 n_ban_add - N new bans added
111 0.00 1.23 hcb_nolock - HCB Lookups without lock
68 0.00 0.76 hcb_lock - HCB Lookups with lock
68 0.00 0.76 hcb_insert - HCB Inserts
90 1.00 1.00 uptime - Client uptime
1 0.00 0.01 LCK.sms.creat - Created locks
1 0.00 0.01 LCK.sma.creat - Created locks
137 0.00 1.52 LCK.sma.locks - Lock Operations
1 0.00 0.01 LCK.smf.creat - Created locks
197 0.00 2.19 LCK.smf.locks - Lock Operations
1 0.00 0.01 LCK.hcb.creat - Created locks
69 0.00 0.77 LCK.hcb.locks - Lock Operations
1 0.00 0.01 LCK.vcl.creat - Created locks
7 0.00 0.08 LCK.vcl.locks - Lock Operations
1 0.00 0.01 LCK.stat.creat - Created locks
116 1.00 1.29 LCK.stat.locks - Lock Operations
1 0.00 0.01 LCK.sessmem.creat - Created locks
122 1.00 1.36 LCK.sessmem.locks - Lock Operations
1 0.00 0.01 LCK.wstat.creat - Created locks
185 2.00 2.06 LCK.wstat.locks - Lock Operations
1 0.00 0.01 LCK.herder.creat - Created locks
1 0.00 0.01 LCK.herder.locks - Lock Operations
2 0.00 0.02 LCK.wq.creat - Created locks
598 2.00 6.64 LCK.wq.locks - Lock Operations
70 0.00 0.78 LCK.objhdr.creat - Created locks
444 0.00 4.93 LCK.objhdr.locks - Lock Operations
1 0.00 0.01 LCK.exp.creat - Created locks
159 1.00 1.77 LCK.exp.locks - Lock Operations
2 0.00 0.02 LCK.lru.creat - Created locks
68 0.00 0.76 LCK.lru.locks - Lock Operations
1 0.00 0.01 LCK.cli.creat - Created locks
44 0.00 0.49 LCK.cli.locks - Lock Operations
1 0.00 0.01 LCK.ban.creat - Created locks
161 1.00 1.79 LCK.ban.locks - Lock Operations
1 0.00 0.01 LCK.vbp.creat - Created locks
1 0.00 0.01 LCK.vbe.creat - Created locks
9 0.00 0.10 LCK.vbe.locks - Lock Operations
1 0.00 0.01 LCK.backend.creat - Created locks
205 0.00 2.28 LCK.backend.locks - Lock Operations
136 0.00 1.51 SMF.s0.c_req - Allocator requests
8224768 0.00 91386.31 SMF.s0.c_bytes - Bytes allocated
7618560 0.00 84650.67 SMF.s0.c_freed - Bytes freed
136 . . SMF.s0.g_alloc - Allocations outstanding
606208 . . SMF.s0.g_bytes - Bytes outstanding
1073135616 . . SMF.s0.g_space - Bytes available
138 . . SMF.s0.g_smf - N struct smf
2 . . SMF.s0.g_smf_large - N large free smf
56 0.00 0.62 SMA.Transient.c_req - Allocator requests
3295501 0.00 36616.68 SMA.Transient.c_bytes - Bytes allocated
3295501 0.00 36616.68 SMA.Transient.c_freed - Bytes freed
1 . . VBE.default(207.58.131.233,,8080).vcls - VCL references
知道这里发生了什么以及为什么我的所有网站都会返回/cgi-sys/defaultwebpage.cgi页面?最后使用端口:8080返回我的网站,但所有的css,js和图像都被删除了。真的,真的很感激一些帮助。