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: //proc/thread-self/root/usr/share/doc/varnish-6.0.3/html/tutorial/starting_varnish.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>Starting 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="Put Varnish on port 80" href="putting_varnish_on_port_80.html" />
    <link rel="prev" title="The fundamentals of web proxy caching with Varnish" href="introduction.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="putting_varnish_on_port_80.html" title="Put Varnish on port 80"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="introduction.html" title="The fundamentals of web proxy caching with Varnish"
             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">The Varnish Tutorial</a> &#187;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="starting-varnish">
<span id="tutorial-starting-varnish"></span><h1>Starting Varnish<a class="headerlink" href="#starting-varnish" title="Permalink to this headline">¶</a></h1>
<p>This tutorial will assume that you are running Varnish on Ubuntu, Debian,
Red Hat Enterprise Linux or CentOS. Those of you running on other
platforms might have to do some mental translation exercises in order
to follow this. Since you’re on a “weird” platform you’re probably used
to it. :-)</p>
<p>Make sure you have Varnish successfully installed (following one of the
procedures described in “Installing Varnish” above.</p>
<p>When properly installed you start Varnish with <code class="docutils literal notranslate"><span class="pre">service</span> <span class="pre">varnish</span> <span class="pre">start</span></code>.  This
will start Varnish if it isn’t already running.</p>
<p>Now you have Varnish running. Let us make sure that it works
properly. Use your browser to go to <a class="reference external" href="http://127.0.0.1:6081/">http://127.0.0.1:6081/</a> (Replace the IP
address with the IP for the machine that runs Varnish) The default
configuration will try to forward requests to a web application running on the
same machine as Varnish was installed on. Varnish expects the web application
to be exposed over http on port 8080.</p>
<p>If there is no web application being served up on that location Varnish will
issue an error. Varnish Cache is very conservative about telling the
world what is wrong so whenever something is amiss it will issue the
same generic “Error 503 Service Unavailable”.</p>
<p>You might have a web application running on some other port or some
other machine. Let’s edit the configuration and make it point to
something that actually works.</p>
<p>Fire up your favorite editor and edit <cite>/etc/varnish/default.vcl</cite>. Most
of it is commented out but there is some text that is not. It will
probably look like this:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">vcl</span> <span class="mf">4.0</span><span class="p">;</span>

<span class="n">backend</span> <span class="n">default</span> <span class="p">{</span>
    <span class="o">.</span><span class="n">host</span> <span class="o">=</span> <span class="s2">&quot;127.0.0.1&quot;</span><span class="p">;</span>
    <span class="o">.</span><span class="n">port</span> <span class="o">=</span> <span class="s2">&quot;8080&quot;</span><span class="p">;</span>
<span class="p">}</span>
</pre></div>
</div>
<p>We’ll change it and make it point to something that works. Hopefully
<a class="reference external" href="http://www.varnish-cache.org/">http://www.varnish-cache.org/</a> is up. Let’s use that. Replace the text with:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">vcl</span> <span class="mf">4.0</span><span class="p">;</span>

<span class="n">backend</span> <span class="n">default</span> <span class="p">{</span>
    <span class="o">.</span><span class="n">host</span> <span class="o">=</span> <span class="s2">&quot;www.varnish-cache.org&quot;</span><span class="p">;</span>
    <span class="o">.</span><span class="n">port</span> <span class="o">=</span> <span class="s2">&quot;80&quot;</span><span class="p">;</span>
<span class="p">}</span>
</pre></div>
</div>
<p>Now issue <code class="docutils literal notranslate"><span class="pre">service</span> <span class="pre">varnish</span> <span class="pre">reload</span></code> to make Varnish reload it’s
configuration. If that succeeded visit <a class="reference external" href="http://127.0.0.1:6081/">http://127.0.0.1:6081/</a> in your
browser and you should see some directory listing. It works! The
reason you’re not seeing the Varnish official website is because your
client isn’t sending the appropriate <cite>Host</cite> header in the request and
it ends up showing a listing of the default webfolder on the machine
usually serving up <a class="reference external" href="http://www.varnish-cache.org/">http://www.varnish-cache.org/</a> .</p>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h4>Previous topic</h4>
  <p class="topless"><a href="introduction.html"
                        title="previous chapter">The fundamentals of web proxy caching with Varnish</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="putting_varnish_on_port_80.html"
                        title="next chapter">Put Varnish on port 80</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../_sources/tutorial/starting_varnish.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="putting_varnish_on_port_80.html" title="Put Varnish on port 80"
             >next</a> |</li>
        <li class="right" >
          <a href="introduction.html" title="The fundamentals of web proxy caching with Varnish"
             >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" >The Varnish Tutorial</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>