File manager - Edit - /usr/share/doc/varnish/html/tutorial/putting_varnish_on_port_80.html
Back
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Put Varnish on port 80 — Varnish version 7.1.1 documentation</title> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../_static/classic.css" type="text/css" /> <script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <script src="../_static/jquery.js"></script> <script src="../_static/underscore.js"></script> <script 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 7.1.1 documentation</a> »</li> <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">The Varnish Tutorial</a> »</li> <li class="nav-item nav-item-this"><a href="">Put Varnish on port 80</a></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">"-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"</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">"-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"</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 class="clearer"></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 id="searchlabel">Quick search</h3> <div class="searchformwrapper"> <form class="search" action="../search.html" method="get"> <input type="text" name="q" aria-labelledby="searchlabel" /> <input type="submit" value="Go" /> </form> </div> </div> <script>$('#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 7.1.1 documentation</a> »</li> <li class="nav-item nav-item-1"><a href="index.html" >The Varnish Tutorial</a> »</li> <li class="nav-item nav-item-this"><a href="">Put Varnish on port 80</a></li> </ul> </div> <div class="footer" role="contentinfo"> © Copyright 2010-2014, Varnish Software AS. Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.4.3. </div> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 8.2.9 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings