Varnish setup

Category: /knowledge /linux
Tags: linux

Installation

sudo aptitude install varnish

Configuration Setup

# Configuration file for varnish


# Main configuration file. You probably want to change it :)
VARNISH_VCL_CONF=/etc/varnish/vcl.conf

# Default address and port to bind to
VARNISH_LISTEN_ADDRESS=0.0.0.0
#VARNISH_LISTEN_ADDRESS=should put your local ip address
VARNISH_LISTEN_PORT=8087


# Telnet admin interface listen address and port
VARNISH_ADMIN_LISTEN_ADDRESS=127.0.0.1
VARNISH_ADMIN_LISTEN_PORT=6082


# The minimum number of threads to start
VARNISH_MIN_WORKER_THREADS=1


# Maximum number of worker threads or INF for unlimited
VARNISH_MAX_WORKER_THREADS=2048


# Timeout value in seconds for threads to return
VARNISH_WORKER_THREAD_TIMEOUT=10 


# Hash algorithm to be used
VARNISH_HASHOPTION=classic


# Maximum size of the backend storagefile in bytes
VARNISH_BACKEND_STORAGE_SIZE=10240000
VARNISH_BACKEND_STORAGE_FILE=/var/lib/varnish/varnish_storage.bin


# Backend storage specification
VARNISH_BACKEND_STORAGE="file,${VARNISH_BACKEND_STORAGE_FILE},${VARNISH_BACKEND_STORAGE_SIZE}"


# Set default ttl in secounds
VARNISH_TTL=120

How To

clear cache ————— * check /etc/default/varnish * telnet 127.0.0.1 6082 * url.purge .*

评论

提示

  • 如果看不到评论部分, 请暂时关掉adblock in Firefox/Chrome
  • 本网站使用Javascript实现评论功能, 此处外链对提高您的网站PR没有帮助. (潜台词: 请不要灌水, 谢谢)