tar zxvf /usr/local/src/varnish-1.1.1.tar.gz
cd /usr/local/src/varnish-1.1.1
./autogen.sh
./configure --enable-debugging-symbols --enable-developer-warnings --enable-dependency-tracking
vi start.sh
# file: go.sh
date -u
/usr/local/varnish/sbin/varnishd \
-a 10.0.0.129:80 \
-s file,/cache/varnish/V,1024m \
-f /usr/local/varnish/sbin/vg.vcl.default \
-p thread_pool_max=1500 \
-p thread_pools=5 \
-p listen_depth=512 \
-p client_http11=on \
-s 指定cache目录的存储类型,文件位置和大小。
-p 是指定varnish的启动的一些启动参数,可以根据自己的机器配置来优化varnish的性能。
set backend.host = "127.0.0.1";
set backend.port = "http";
}
if (req.request != "GET" && req.request != "HEAD") {
pipe;
}
if (req.http.Expect) {
pipe;
}
if (req.http.Authenticate || req.http.Cookie) {
pass;
}
if (req.request == "GET" && req.url ~ "\.(gif|jpg|swf|css|js)$") {
lookup;
}
lookup;
}
sub vcl_pipe {
pipe;
}
sub vcl_pass {
pass;
}
sub vcl_hash {
hash;
}
sub vcl_hit {
if (!obj.cacheable) {
pass;
}
deliver;
}
sub vcl_timeout {
discard;
}
sub vcl_discard {
discard;
}
set backend.host = "www.jackbillow.com";
set backend.port = "80";
}
backend p_w_picpaths {
set backend.host = "p_w_picpaths.jackbillow.com";
set backend.port = "80";
}
sub vcl_recv {
if (req.http.host ~ "^(www.)?jackbillow.com$") {
set req.http.host = "www.jackbillow.com";
set req.backend = www;
} elsif (req.http.host ~ "^p_w_picpaths.jackbillow.com$") {
set req.backend = p_w_picpaths;
} else {
error 404 "Unknown virtual host";
}
Mon Sep 3 03:13:19 UTC 2007
file /cache/varnish/V/varnish.tEKXXx (unlinked) size 1073741824 bytes (262144 fs-blocks, 262144 pages)
Using old SHMFILE
ps waux | grep varnish a
root 16254 0.0 0.0 11200 708 ? Ss 10:43 0:00 /usr/local/varnish/sbin/varnishd -a 10.0.0.129:80 -s /varnish/V,1024m
-f /usr/local/varnish/sbin/vg.vcl.default -p thread_pool_max 1500 -p thread_pools 5 -p listen_depth 512 -p client_http11 on
nobody 16255 0.0 0.1 1152552 1808 ? Sl 10:43 0:00 /usr/local/varnish/sbin/varnishd -a 10.0.0.129:80 -s
file,/cache/varnish/V,1024m -f /usr/local/varnish/sbin/vg.vcl.default -p thread_pool_max 1500 -p thread_pools 5 -p
listen_depth 512 -p client_http11 on