HEX
Server: Apache
System: Linux vpshost0650.publiccloud.com.br 4.4.79-grsec-1.lc.x86_64 #1 SMP Wed Aug 2 14:18:21 -03 2017 x86_64
User: bandeirantesbomb3 (10068)
PHP: 8.0.7
Disabled: apache_child_terminate,dl,escapeshellarg,escapeshellcmd,exec,link,mail,openlog,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,php_check_syntax,php_strip_whitespace,popen,proc_close,proc_open,shell_exec,symlink,system
Upload Files
File: //usr/share/doc/varnish-6.0.3/html/installation/install.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Installing Varnish &#8212; Varnish version 6.0.3 documentation</title>
    <link rel="stylesheet" href="../_static/classic.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Getting help" href="help.html" />
    <link rel="prev" title="Prerequisites" href="prerequisites.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="help.html" title="Getting help"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="prerequisites.html" title="Prerequisites"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../index.html">Varnish version 6.0.3 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Varnish Installation</a> &#187;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="installing-varnish">
<span id="install-doc"></span><h1>Installing Varnish<a class="headerlink" href="#installing-varnish" title="Permalink to this headline">¶</a></h1>
<p>With open source software, you can choose to install binary packages or compile
it yourself from source code. To install a package or compile from source is a
matter of personal taste. If you don’t know which method to choose, we
recommend that you read this whole section and then choose the method you feel
most comfortable with.</p>
<div class="section" id="source-or-packages">
<h2>Source or packages?<a class="headerlink" href="#source-or-packages" title="Permalink to this headline">¶</a></h2>
<p>Installing Varnish on most relevant operating systems can usually
be done with with the specific systems package manager, typical examples
being:</p>
</div>
<div class="section" id="freebsd">
<h2>FreeBSD<a class="headerlink" href="#freebsd" title="Permalink to this headline">¶</a></h2>
<dl class="docutils">
<dt>Binary package:</dt>
<dd><code class="docutils literal notranslate"><span class="pre">pkg_add</span> <span class="pre">-r</span> <span class="pre">varnish4</span></code></dd>
<dt>From source:</dt>
<dd><code class="docutils literal notranslate"><span class="pre">cd</span> <span class="pre">/usr/ports/www/varnish4</span> <span class="pre">&amp;&amp;</span> <span class="pre">make</span> <span class="pre">install</span> <span class="pre">clean</span></code></dd>
</dl>
</div>
<div class="section" id="red-hat-centos">
<h2>Red Hat / CentOS<a class="headerlink" href="#red-hat-centos" title="Permalink to this headline">¶</a></h2>
<p>We try to keep the latest version available as prebuilt RPMs (el5 and el6)
on <a class="reference external" href="https://packagecloud.io/varnishcache/">packagecloud.io/varnishcache</a>.  See the online
<a class="reference external" href="https://www.varnish-cache.org/installation/redhat">Red Hat installation instructions</a> for more information.</p>
<p>Varnish is included in the <a class="reference external" href="https://fedoraproject.org/wiki/EPEL">EPEL</a> repository, however due to
incompatible syntax changes in newer versions of Varnish, only older
versions are available.</p>
<p>We therefore recommend that you install the latest version directly from our repository, as described above.</p>
</div>
<div class="section" id="debian-ubuntu">
<h2>Debian/Ubuntu<a class="headerlink" href="#debian-ubuntu" title="Permalink to this headline">¶</a></h2>
<p>Varnish is distributed with both Debian and Ubuntu. In order to get
Varnish up and running type <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">apt-get</span> <span class="pre">install</span> <span class="pre">varnish</span></code>. Please
note that this might not be the latest version of Varnish.  If you
need a later version of Varnish, please follow the online installation
instructions for <a class="reference external" href="https://www.varnish-cache.org/installation/debian">Debian</a> or <a class="reference external" href="https://www.varnish-cache.org/installation/ubuntu">Ubuntu</a>.</p>
</div>
</div>
<div class="section" id="compiling-varnish-from-source">
<h1>Compiling Varnish from source<a class="headerlink" href="#compiling-varnish-from-source" title="Permalink to this headline">¶</a></h1>
<p>If there are no binary packages available for your system, or if you
want to compile Varnish from source for other reasons, follow these
steps:</p>
<p>Download the appropriate release tarball, which you can find on
<a class="reference external" href="https://varnish-cache.org/releases/">https://varnish-cache.org/releases/</a> .</p>
<p>Alternatively, if you want to hack on Varnish, you should clone our
git repository by doing.</p>
<blockquote>
<div><code class="docutils literal notranslate"><span class="pre">git</span> <span class="pre">clone</span> <span class="pre">https://github.com/varnishcache/varnish-cache</span></code></div></blockquote>
<div class="section" id="build-dependencies-on-debian-ubuntu">
<h2>Build dependencies on Debian / Ubuntu<a class="headerlink" href="#build-dependencies-on-debian-ubuntu" title="Permalink to this headline">¶</a></h2>
<p>In order to build Varnish from source you need a number of packages
installed. On a Debian or Ubuntu system, use this command to install
them (replace <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">apt-get</span> <span class="pre">install</span></code> if needed):</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="n">install</span> \
    <span class="n">make</span> \
    <span class="n">automake</span> \
    <span class="n">autotools</span><span class="o">-</span><span class="n">dev</span> \
    <span class="n">libedit</span><span class="o">-</span><span class="n">dev</span> \
    <span class="n">libjemalloc</span><span class="o">-</span><span class="n">dev</span> \
    <span class="n">libncurses</span><span class="o">-</span><span class="n">dev</span> \
    <span class="n">libpcre3</span><span class="o">-</span><span class="n">dev</span> \
    <span class="n">libtool</span> \
    <span class="n">pkg</span><span class="o">-</span><span class="n">config</span> \
    <span class="n">python</span><span class="o">-</span><span class="n">docutils</span> \
    <span class="n">python</span><span class="o">-</span><span class="n">sphinx</span>
</pre></div>
</div>
<p>Optionally, to rebuild the svg files:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="n">install</span> <span class="n">graphviz</span>
</pre></div>
</div>
<p>Recommended, in particular if you plan on building custom vmods:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="n">install</span> <span class="n">autoconf</span><span class="o">-</span><span class="n">archive</span>
</pre></div>
</div>
<p>Optionally, to pull from a repository:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="n">install</span> <span class="n">git</span>
</pre></div>
</div>
</div>
<div class="section" id="build-dependencies-on-red-hat-centos">
<h2>Build dependencies on Red Hat / CentOS<a class="headerlink" href="#build-dependencies-on-red-hat-centos" title="Permalink to this headline">¶</a></h2>
<p>To build Varnish on a Red Hat or CentOS system, this command should
install required packages (replace <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">yum</span> <span class="pre">install</span></code> if needed):</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">yum</span> <span class="n">install</span> \
    <span class="n">make</span> \
    <span class="n">autoconf</span> \
    <span class="n">automake</span> \
    <span class="n">jemalloc</span><span class="o">-</span><span class="n">devel</span> \
    <span class="n">libedit</span><span class="o">-</span><span class="n">devel</span> \
    <span class="n">libtool</span> \
    <span class="n">ncurses</span><span class="o">-</span><span class="n">devel</span> \
    <span class="n">pcre</span><span class="o">-</span><span class="n">devel</span> \
    <span class="n">pkgconfig</span> \
    <span class="n">python</span><span class="o">-</span><span class="n">docutils</span> \
    <span class="n">python</span><span class="o">-</span><span class="n">sphinx</span>
</pre></div>
</div>
<p>Optionally, to rebuild the svg files:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">yum</span> <span class="n">install</span> <span class="n">graphviz</span>
</pre></div>
</div>
<p>Optionally, to pull from a repository:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">yum</span> <span class="n">install</span> <span class="n">git</span>
</pre></div>
</div>
</div>
<div class="section" id="build-dependencies-on-a-smartos-zone">
<h2>Build dependencies on a SmartOS Zone<a class="headerlink" href="#build-dependencies-on-a-smartos-zone" title="Permalink to this headline">¶</a></h2>
<p>As of SmartOS pkgsrc 2017Q1, install the following packages:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pkgin</span> <span class="ow">in</span> <span class="n">autoconf</span> <span class="n">automake</span> <span class="n">libedit</span> <span class="n">libtool</span> <span class="n">ncurses</span> \
         <span class="n">pcre</span> <span class="n">py27</span><span class="o">-</span><span class="n">sphinx</span> <span class="n">python27</span> <span class="n">gmake</span> <span class="n">gcc49</span> <span class="n">pkg</span><span class="o">-</span><span class="n">config</span>
</pre></div>
</div>
<p>Optionally, to rebuild the svg files:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pkgin</span> <span class="ow">in</span> <span class="n">graphviz</span>
</pre></div>
</div>
<p>Optionally, to pull from a repository:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pkgin</span> <span class="ow">in</span> <span class="n">git</span>
</pre></div>
</div>
</div>
<div class="section" id="building-on-solaris-and-other-solaris-ish-oses">
<h2>Building on Solaris and other Solaris-ish OSes<a class="headerlink" href="#building-on-solaris-and-other-solaris-ish-oses" title="Permalink to this headline">¶</a></h2>
<p>Building with gcc should be straight forward, as long as the above
requirements are installed.</p>
<p>By convention, consider installing Varnish under <cite>/opt/local</cite> using:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">./</span><span class="n">configure</span> \
<span class="o">--</span><span class="n">prefix</span><span class="o">=/</span><span class="n">opt</span><span class="o">/</span><span class="n">local</span> \
<span class="o">--</span><span class="n">mandir</span><span class="o">=/</span><span class="n">opt</span><span class="o">/</span><span class="n">local</span><span class="o">/</span><span class="n">man</span>
</pre></div>
</div>
<p>Alternatively, building with Solaris Studio 12.4 should work
considering the following recommendations:</p>
<ul>
<li><p class="first">have GNU <cite>nm</cite> in <cite>$PATH</cite> before Solaris <cite>nm</cite></p>
</li>
<li><p class="first">Provide compiler flags for <cite>configure</cite> to include paths under which
dependencies are installed. Example for <cite>/opt/local</cite>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">./</span><span class="n">configure</span> \
<span class="o">--</span><span class="n">prefix</span><span class="o">=/</span><span class="n">opt</span><span class="o">/</span><span class="n">local</span> \
<span class="o">--</span><span class="n">mandir</span><span class="o">=/</span><span class="n">opt</span><span class="o">/</span><span class="n">local</span><span class="o">/</span><span class="n">man</span>
<span class="n">CPPFLAGS</span><span class="o">=</span><span class="s2">&quot;-I/opt/local/include&quot;</span> \
<span class="n">CFLAGS</span><span class="o">=</span><span class="s2">&quot;-m64&quot;</span> \
<span class="n">LDFLAGS</span><span class="o">=</span><span class="s2">&quot;-L/opt/local/lib -R/opt/local/lib&quot;</span>
</pre></div>
</div>
</li>
</ul>
</div>
<div class="section" id="compiling-varnish">
<h2>Compiling Varnish<a class="headerlink" href="#compiling-varnish" title="Permalink to this headline">¶</a></h2>
<p>The configuration will need the dependencies above satisfied. Once that is
taken care of:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cd</span> <span class="n">varnish</span><span class="o">-</span><span class="n">cache</span>
<span class="n">sh</span> <span class="n">autogen</span><span class="o">.</span><span class="n">sh</span>
<span class="n">sh</span> <span class="n">configure</span>
<span class="n">make</span>
</pre></div>
</div>
<p>The <cite>configure</cite> script takes some arguments, but more likely than not you can
forget about that for now, almost everything in Varnish can be tweaked with run
time parameters.</p>
<p>Before you install, you may want to run the test suite, make a cup of
tea while it runs, it usually takes a couple of minutes:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">make</span> <span class="n">check</span>
</pre></div>
</div>
<p>Don’t worry if one or two tests fail. Some of the tests are a
bit too timing sensitive (Please tell us which so we can fix them).
However, if a lot of them fail, and in particular if the <cite>b00000.vtc</cite> test
fails, something is horribly wrong. You will get nowhere without
figuring this one out.</p>
</div>
<div class="section" id="installing">
<h2>Installing<a class="headerlink" href="#installing" title="Permalink to this headline">¶</a></h2>
<p>And finally, the true test of a brave heart: <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">make</span> <span class="pre">install</span></code></p>
<p>Varnish will now be installed in <code class="docutils literal notranslate"><span class="pre">/usr/local</span></code>. The <code class="docutils literal notranslate"><span class="pre">varnishd</span></code> binary is in
<cite>/usr/local/sbin/varnishd</cite>. To make sure that the necessary links and caches
of the most recent shared libraries are found, run <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">ldconfig</span></code>.</p>
</div>
</div>
<div class="section" id="next-steps">
<h1>Next steps<a class="headerlink" href="#next-steps" title="Permalink to this headline">¶</a></h1>
<p>After successful installation you are ready to proceed to the <a class="reference internal" href="../tutorial/index.html#tutorial-index"><span class="std std-ref">The Varnish Tutorial</span></a>.</p>
<p>This tutorial is written for installations from binary packages.
In practice, it means that some configurations are not in place for installations from source code.
For example, instead of calling <code class="docutils literal notranslate"><span class="pre">service</span> <span class="pre">varnish</span> <span class="pre">start</span></code>, you start the varnish daemon manually by typing:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">varnishd</span> <span class="o">-</span><span class="n">a</span> <span class="p">:</span><span class="mi">6081</span> <span class="o">-</span><span class="n">T</span> <span class="n">localhost</span><span class="p">:</span><span class="mi">6082</span> <span class="o">-</span><span class="n">b</span> <span class="n">localhost</span><span class="p">:</span><span class="mi">8080</span>
</pre></div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Installing Varnish</a><ul>
<li><a class="reference internal" href="#source-or-packages">Source or packages?</a></li>
<li><a class="reference internal" href="#freebsd">FreeBSD</a></li>
<li><a class="reference internal" href="#red-hat-centos">Red Hat / CentOS</a></li>
<li><a class="reference internal" href="#debian-ubuntu">Debian/Ubuntu</a></li>
</ul>
</li>
<li><a class="reference internal" href="#compiling-varnish-from-source">Compiling Varnish from source</a><ul>
<li><a class="reference internal" href="#build-dependencies-on-debian-ubuntu">Build dependencies on Debian / Ubuntu</a></li>
<li><a class="reference internal" href="#build-dependencies-on-red-hat-centos">Build dependencies on Red Hat / CentOS</a></li>
<li><a class="reference internal" href="#build-dependencies-on-a-smartos-zone">Build dependencies on a SmartOS Zone</a></li>
<li><a class="reference internal" href="#building-on-solaris-and-other-solaris-ish-oses">Building on Solaris and other Solaris-ish OSes</a></li>
<li><a class="reference internal" href="#compiling-varnish">Compiling Varnish</a></li>
<li><a class="reference internal" href="#installing">Installing</a></li>
</ul>
</li>
<li><a class="reference internal" href="#next-steps">Next steps</a></li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="prerequisites.html"
                        title="previous chapter">Prerequisites</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="help.html"
                        title="next chapter">Getting help</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../_sources/installation/install.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="help.html" title="Getting help"
             >next</a> |</li>
        <li class="right" >
          <a href="prerequisites.html" title="Prerequisites"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../index.html">Varnish version 6.0.3 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="index.html" >Varnish Installation</a> &#187;</li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2010-2014, Varnish Software AS.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.6.
    </div>
  </body>
</html>