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/putting_varnish_on_port_80.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>Put Varnish on port 80 &#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="Backend servers" href="backend_servers.html" />
    <link rel="prev" title="Starting Varnish" href="starting_varnish.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="backend_servers.html" title="Backend servers"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="starting_varnish.html" title="Starting 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="put-varnish-on-port-80">
<h1>Put Varnish on port 80<a class="headerlink" href="#put-varnish-on-port-80" title="Permalink to this headline">¶</a></h1>
<p>Until now we’ve been running with Varnish on a high port which is great for
testing purposes. Let’s now put Varnish on the default HTTP port 80.</p>
<p>First we stop varnish: <code class="docutils literal notranslate"><span class="pre">service</span> <span class="pre">varnish</span> <span class="pre">stop</span></code></p>
<p>Now we need to edit the configuration file that starts Varnish.</p>
<div class="section" id="debian-ubuntu-legacy">
<h2>Debian/Ubuntu (legacy)<a class="headerlink" href="#debian-ubuntu-legacy" title="Permalink to this headline">¶</a></h2>
<p>On older Debian/Ubuntu this is <cite>/etc/default/varnish</cite>. In the file you’ll find
some text that looks like this:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">DAEMON_OPTS</span><span class="o">=</span><span class="s2">&quot;-a :6081 </span><span class="se">\</span>
<span class="s2">             -T localhost:6082 </span><span class="se">\</span>
<span class="s2">             -f /etc/varnish/default.vcl </span><span class="se">\</span>
<span class="s2">             -S /etc/varnish/secret </span><span class="se">\</span>
<span class="s2">             -s default,256m&quot;</span>
</pre></div>
</div>
<p>Change it to:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">DAEMON_OPTS</span><span class="o">=</span><span class="s2">&quot;-a :80 </span><span class="se">\</span>
<span class="s2">             -T localhost:6082 </span><span class="se">\</span>
<span class="s2">             -f /etc/varnish/default.vcl </span><span class="se">\</span>
<span class="s2">             -S /etc/varnish/secret </span><span class="se">\</span>
<span class="s2">             -s default,256m&quot;</span>
</pre></div>
</div>
</div>
<div class="section" id="debian-v8-ubuntu-v15-04">
<h2>Debian (v8+) / Ubuntu (v15.04+)<a class="headerlink" href="#debian-v8-ubuntu-v15-04" title="Permalink to this headline">¶</a></h2>
<p>On more recent Debian and Ubuntu systems this is configured in the systemd
service file.</p>
<p>Applying changes to the default service is best done by creating a new file
<cite>/etc/systemd/system/varnish.service.d/customexec.conf</cite>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">Service</span><span class="p">]</span>
<span class="n">ExecStart</span><span class="o">=</span>
<span class="n">ExecStart</span><span class="o">=/</span><span class="n">usr</span><span class="o">/</span><span class="n">sbin</span><span class="o">/</span><span class="n">varnishd</span> <span class="o">-</span><span class="n">a</span> <span class="p">:</span><span class="mi">80</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">f</span> <span class="o">/</span><span class="n">etc</span><span class="o">/</span><span class="n">varnish</span><span class="o">/</span><span class="n">default</span><span class="o">.</span><span class="n">vcl</span> <span class="o">-</span><span class="n">S</span> <span class="o">/</span><span class="n">etc</span><span class="o">/</span><span class="n">varnish</span><span class="o">/</span><span class="n">secret</span> <span class="o">-</span><span class="n">s</span> <span class="n">default</span><span class="p">,</span><span class="mi">256</span><span class="n">m</span>
</pre></div>
</div>
<p>This will override the ExecStart part of the default configuration shipped
with Varnish Cache.</p>
<p>Run <code class="docutils literal notranslate"><span class="pre">systemctl</span> <span class="pre">daemon-reload</span></code> to make sure systemd picks up the new
configuration before restarting Varnish.</p>
</div>
<div class="section" id="red-hat-enterprise-linux-centos">
<h2>Red Hat Enterprise Linux / CentOS<a class="headerlink" href="#red-hat-enterprise-linux-centos" title="Permalink to this headline">¶</a></h2>
<p>On Red Hat/CentOS you can find a similar configuration file in
<cite>/etc/sysconfig/varnish</cite>.</p>
</div>
</div>
<div class="section" id="restarting-varnish-again">
<h1>Restarting Varnish again<a class="headerlink" href="#restarting-varnish-again" title="Permalink to this headline">¶</a></h1>
<p>Once the change is done, restart Varnish: <code class="docutils literal notranslate"><span class="pre">service</span> <span class="pre">varnish</span> <span class="pre">start</span></code>.</p>
<p>Now everyone accessing your site will be accessing through Varnish.</p>
</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="#">Put Varnish on port 80</a><ul>
<li><a class="reference internal" href="#debian-ubuntu-legacy">Debian/Ubuntu (legacy)</a></li>
<li><a class="reference internal" href="#debian-v8-ubuntu-v15-04">Debian (v8+) / Ubuntu (v15.04+)</a></li>
<li><a class="reference internal" href="#red-hat-enterprise-linux-centos">Red Hat Enterprise Linux / CentOS</a></li>
</ul>
</li>
<li><a class="reference internal" href="#restarting-varnish-again">Restarting Varnish again</a></li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="starting_varnish.html"
                        title="previous chapter">Starting Varnish</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="backend_servers.html"
                        title="next chapter">Backend servers</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../_sources/tutorial/putting_varnish_on_port_80.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="backend_servers.html" title="Backend servers"
             >next</a> |</li>
        <li class="right" >
          <a href="starting_varnish.html" title="Starting 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>