SOURCE Varnish Installation

Source: Internet
Author: User
Tags varnish

    1. Download source code


    2. Compile

      > TAR-XZVF varnish-4.03.tar.gz

      Enter the source directory

      > SH

      > Export pkg_config_path=/usr/local/lib/pkgconfig/

      >./configure--prefix=/usr/local/varnish--enable-dependency-tracking--enable-debugging-symbols-- Enable-developer-warnings

      > Make && make

      * Libpcre errors and Libedit or readline errors may not be reported during the configure process. You may need to install Pcre and ReadLine separately. 8.0 or more versions of Pcre do not seem to support.

    3. Test

Simply create a DEFAULT.VCL file

Backend default{

. host;

. port 8080;


Command line execution

>./varnishd-f. /etc/default.vcl-a malloc,1g-f-u varnish-g Varnish

* Pay attention to first build a user varnish:varnish

Output information for success

Child (80451) Started

Child (80451) said child starts

4. Service Configuration

> CP varnish.initrc/etc/init.d/varnish

> CP varnish.sysconfig/etc/sysconfig/varnish


Modify the/etc/init.d/varnish file, mainly speaking the correct path modification

Exec= "/usr/local/varnish/sbin/varnishd"


Prog= "Varnishd"

Config= "/etc/sysconfig/varnish"

Lockfile= "/var/lock/subsys/varnish"

Modify the/etc/sysconfig/varnish file


Varnish_secret_file=/usr/local/varnish/etc/secret #etc/varnish/secret Source installation Without this file, you need to create a, fill in the key

Daemon_opts= "-A ${varnish_listen_address}:${varnish_listen_port} \

-F ${varnish_vcl_conf} \

-T ${varnish_admin_listen_address}:${varnish_admin_listen_port} \

-T ${varnish_ttl} \

-P thread_pool_min=${varnish_min_threads} \

-P thread_pool_max=${varnish_max_threads} \

-P thread_pool_timeout=${varnish_thread_timeout} \

- u varnish-g varnish \

-S ${varnish_secret_file} \

-S ${varnish_storage} "

> Service varnish start

In particular, if you are 64-bit Linux, do not install it in Yum mode.

SOURCE Varnish Installation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.