<!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="Content-Type" content="text/html; charset=utf-8" /> <title>Running a smart server — Bazaar 2.6.0 documentation</title> <link rel="stylesheet" href="../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../', VERSION: '2.6.0', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </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="shortcut icon" href="../_static/bzr.ico"/> <link rel="top" title="Bazaar 2.6.0 documentation" href="../index.html" /> <link rel="up" title="Bazaar User Guide" href="index.html" /> <link rel="next" title="Using hooks" href="hooks.html" /> <link rel="prev" title="Using stacked branches" href="stacked.html" /> </head> <body> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="hooks.html" title="Using hooks" accesskey="N">next</a></li> <li class="right" > <a href="stacked.html" title="Using stacked branches" accesskey="P">previous</a> |</li> <li><a href="http://bazaar.canonical.com/"> <img src="../_static/bzr icon 16.png" /> Home</a> | </li> <a href="http://doc.bazaar.canonical.com/en/">Documentation</a> | </li> <li><a href="../index.html">Table of Contents (2.6.0)</a> »</li> <li><a href="index.html" accesskey="U">Bazaar User Guide</a> »</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="running-a-smart-server"> <h1>Running a smart server<a class="headerlink" href="#running-a-smart-server" title="Permalink to this headline">¶</a></h1> <p>Bazaar does not require a specialised server because it operates over HTTP, FTP or SFTP. There is an optional smart server that can be invoked over SSH, from inetd, or in a dedicated mode.</p> <div class="section" id="dumb-servers"> <h2>Dumb servers<a class="headerlink" href="#dumb-servers" title="Permalink to this headline">¶</a></h2> <p>We describe HTTP, FTP, SFTP and HTTP-WebDAV as “dumb” servers because they do not offer any assistance to Bazaar. If you make a Bazaar repository available over any of these protocols, Bazaar will allow you to read it remotely. Just enter the URL to the branch in the Bazaar command you are running.:</p> <div class="highlight-python"><pre>bzr log http://bazaar.launchpad.net/~bzr-pqm/bzr/bzr.dev</pre> </div> <p>Bazaar supports writing over FTP, SFTP and (via a plugin) over HTTP-WebDAV.</p> </div> <div class="section" id="high-performance-smart-server"> <h2>High-performance smart server<a class="headerlink" href="#high-performance-smart-server" title="Permalink to this headline">¶</a></h2> <p>The high-performance smart server (hpss) performs certain operations much faster than dumb servers are capable of. In future releases, the range of operations that are improved by using the smart server will increase as we continue to tune performance.</p> <p>To maintain the highest security possible, the current smart server provides read-only access by default. To enable read-write access, run it with <tt class="docutils literal"><span class="pre">--allow-writes</span></tt>. When using the SSH access method, bzr automatically runs with the <tt class="docutils literal"><span class="pre">--allow-writes</span></tt> option.</p> <p>The alternative ways of configuring a smart server are explained below.</p> <div class="section" id="ssh"> <h3>SSH<a class="headerlink" href="#ssh" title="Permalink to this headline">¶</a></h3> <p>Using Bazaar over SSH requires no special configuration on the server; so long as Bazaar is installed on the server you can use <tt class="docutils literal"><span class="pre">bzr+ssh</span></tt> URLs, e.g.:</p> <div class="highlight-python"><pre>bzr log bzr+ssh://host/path/to/branch</pre> </div> <p>If <cite>bzr</cite> is not installed system-wide on the server you may need to explicitly tell the local <cite>bzr</cite> where to find the remote <cite>bzr</cite>:</p> <div class="highlight-python"><pre>BZR_REMOTE_PATH=~/bin/bzr bzr log bzr+ssh://host/path/to/branch</pre> </div> <p>The <tt class="docutils literal"><span class="pre">BZR_REMOTE_PATH</span></tt> environment variable adjusts how <cite>bzr</cite> will be invoked on the remote system. By default, just <cite>bzr</cite> will be invoked, which requires the <cite>bzr</cite> executable to be on the default search path. You can also set this permanently per-location in <tt class="docutils literal"><span class="pre">locations.conf</span></tt>.</p> <p>Like SFTP, paths starting with <tt class="docutils literal"><span class="pre">~</span></tt> are relative to your home directory, e.g. <tt class="docutils literal"><span class="pre">bzr+ssh://example.com/~/code/proj</span></tt>. Additionally, paths starting with <tt class="docutils literal"><span class="pre">~user</span></tt> will be relative to that user’s home directory.</p> </div> <div class="section" id="inetd"> <h3>inetd<a class="headerlink" href="#inetd" title="Permalink to this headline">¶</a></h3> <p>This example shows how to run <cite>bzr</cite> with a dedicated user <cite>bzruser</cite> for a shared repository in <tt class="docutils literal"><span class="pre">/srv/bzr/repo</span></tt> which has a branch at <tt class="docutils literal"><span class="pre">/srv/bzr/repo/branchname</span></tt>.</p> <p>Running a Bazaar server from inetd requires an inetd.conf entry:</p> <div class="highlight-python"><pre>4155 stream TCP nowait bzruser /usr/bin/bzr /usr/bin/bzr serve --inet --directory=/srv/bzr/repo</pre> </div> <p>When running client commands, the URL you supply is a <cite>bzr://</cite> URL relative to the <tt class="docutils literal"><span class="pre">--directory</span></tt> option given in inetd.conf:</p> <div class="highlight-python"><pre>bzr log bzr://host/branchname</pre> </div> <p>If possible, paths starting with <tt class="docutils literal"><span class="pre">~</span></tt> and <tt class="docutils literal"><span class="pre">~user</span></tt> will be expanded as for <tt class="docutils literal"><span class="pre">bzr+ssh</span></tt>. Home directories outside the <tt class="docutils literal"><span class="pre">--directory</span></tt> specified to <tt class="docutils literal"><span class="pre">bzr</span> <span class="pre">serve</span></tt> will not be accessible.</p> </div> <div class="section" id="dedicated"> <h3>Dedicated<a class="headerlink" href="#dedicated" title="Permalink to this headline">¶</a></h3> <p>This mode has the same path and URL behaviour as the inetd mode. To run as a specific user, you should use <tt class="docutils literal"><span class="pre">su</span></tt> or login as that user.</p> <p>This example runs bzr on its official port number of <cite>4155</cite> and listens on all interfaces. This allows connections from anywhere in the world that can reach your machine on port <cite>4155</cite>.</p> <p>server:</p> <div class="highlight-python"><pre>bzr serve --directory=/srv/bzr/repo</pre> </div> <p>client:</p> <div class="highlight-python"><pre>bzr log bzr://host/branchname</pre> </div> <p>This example runs <tt class="docutils literal"><span class="pre">bzr</span> <span class="pre">serve</span></tt> on <cite>localhost</cite> port <cite>1234</cite>.</p> <p>server:</p> <div class="highlight-python"><pre>bzr serve --listen=localhost --port=1234 --directory=/srv/bzr/repo</pre> </div> <p>client:</p> <div class="highlight-python"><pre>bzr log bzr://localhost:1234/branchname</pre> </div> </div> </div> </div> </div> </div> </div> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> <h3><a href="../index.html">Table Of Contents</a></h3> <ul> <li><a class="reference internal" href="#">Running a smart server</a><ul> <li><a class="reference internal" href="#dumb-servers">Dumb servers</a></li> <li><a class="reference internal" href="#high-performance-smart-server">High-performance smart server</a><ul> <li><a class="reference internal" href="#ssh">SSH</a></li> <li><a class="reference internal" href="#inetd">inetd</a></li> <li><a class="reference internal" href="#dedicated">Dedicated</a></li> </ul> </li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="stacked.html" title="previous chapter">Using stacked branches</a></p> <h4>Next topic</h4> <p class="topless"><a href="hooks.html" title="next chapter">Using hooks</a></p> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../_sources/user-guide/server.txt" rel="nofollow">Show Source</a></li> </ul> <div id="searchbox" style="display: none"> <h3>Quick search</h3> <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> <p class="searchtip" style="font-size: 90%"> Enter search terms or a module, class or function name. </p> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="hooks.html" title="Using hooks" >next</a></li> <li class="right" > <a href="stacked.html" title="Using stacked branches" >previous</a> |</li> <li><a href="http://bazaar.canonical.com/"> <img src="../_static/bzr icon 16.png" /> Home</a> | </li> <a href="http://doc.bazaar.canonical.com/en/">Documentation</a> | </li> <li><a href="../index.html">Table of Contents (2.6.0)</a> »</li> <li><a href="index.html" >Bazaar User Guide</a> »</li> </ul> </div> <div class="footer"> © Copyright 2009-2011 Canonical Ltd. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3. </div> </body> </html>