[0931098] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[6732c094] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[0931098] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
| 7 | ]>
|
---|
| 8 |
|
---|
[6ff0105] | 9 | <sect1 id="cvsserver" xreflabel="Running a CVS Server">
|
---|
[59bfedf5] | 10 | <?dbhtml filename="cvsserver.html"?>
|
---|
[d5c9dbfb] | 11 |
|
---|
[59bfedf5] | 12 | <sect1info>
|
---|
| 13 | <date>$Date$</date>
|
---|
| 14 | </sect1info>
|
---|
[f45b1953] | 15 |
|
---|
[59bfedf5] | 16 | <title>Running a CVS Server</title>
|
---|
[0931098] | 17 |
|
---|
[59bfedf5] | 18 | <sect2 role="package">
|
---|
| 19 | <title>Running a CVS Server</title>
|
---|
[0931098] | 20 |
|
---|
[59bfedf5] | 21 | <para>This section will describe how to set up, administer and secure
|
---|
| 22 | a CVS server.</para>
|
---|
[d5c9dbfb] | 23 |
|
---|
[59bfedf5] | 24 | <bridgehead renderas="sect3">CVS Server Dependencies</bridgehead>
|
---|
[0931098] | 25 |
|
---|
[59bfedf5] | 26 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
| 27 | <para><xref linkend="cvs"/> and
|
---|
| 28 | <xref linkend="openssh"/></para>
|
---|
[0931098] | 29 |
|
---|
[59bfedf5] | 30 | </sect2>
|
---|
[0931098] | 31 |
|
---|
[59bfedf5] | 32 | <sect2 role="configuration">
|
---|
| 33 | <title>Setting up a CVS Server.</title>
|
---|
[0931098] | 34 |
|
---|
[59bfedf5] | 35 | <para>A CVS server will be set up using OpenSSH as the remote access
|
---|
| 36 | method. Other access methods, including :pserver: and :server: will
|
---|
| 37 | not be used for write access to the CVS repository. The :pserver:
|
---|
| 38 | method sends clear text passwords over the network and the :server:
|
---|
| 39 | method is not supported in all CVS ports. Instructions for anonymous,
|
---|
| 40 | read only CVS access using :pserver: can be found at the end of this
|
---|
| 41 | section.</para>
|
---|
[0931098] | 42 |
|
---|
[59bfedf5] | 43 | <para>Configuration of the CVS server consists of four
|
---|
| 44 | steps:</para>
|
---|
| 45 |
|
---|
| 46 | <sect3>
|
---|
| 47 | <title>1. Create a Repository.</title>
|
---|
| 48 |
|
---|
| 49 | <para>Create a new CVS repository with the following
|
---|
| 50 | commands:</para>
|
---|
| 51 |
|
---|
[efd03f7] | 52 | <screen role="root"><userinput>mkdir /srv/cvsroot &&
|
---|
| 53 | chmod 1777 /srv/cvsroot &&
|
---|
[affc260] | 54 | export CVSROOT=/srv/cvsroot &&
|
---|
[59bfedf5] | 55 | cvs init</userinput></screen>
|
---|
| 56 |
|
---|
| 57 | </sect3>
|
---|
| 58 |
|
---|
| 59 | <sect3>
|
---|
| 60 | <title>2. Import Source Code Into the Repository.</title>
|
---|
| 61 |
|
---|
| 62 | <para>Import a source module into the repository with the following
|
---|
| 63 | commands, issued from a user account on the same machine as the
|
---|
| 64 | CVS repository:</para>
|
---|
| 65 |
|
---|
[3cb0c57] | 66 | <screen><userinput>cd <replaceable><sourcedir></replaceable> &&
|
---|
| 67 | cvs import -m "<replaceable><repository test></replaceable>" <replaceable><cvstest></replaceable> <replaceable><vendortag></replaceable> <replaceable><releasetag></replaceable></userinput></screen>
|
---|
[59bfedf5] | 68 |
|
---|
| 69 | </sect3>
|
---|
[0931098] | 70 |
|
---|
[59bfedf5] | 71 | <sect3>
|
---|
| 72 | <title>3. Verify Local Repository Access.</title>
|
---|
[0931098] | 73 |
|
---|
[59bfedf5] | 74 | <para>Test access to the CVS repository from the same user
|
---|
| 75 | account with the following command:</para>
|
---|
[0931098] | 76 |
|
---|
[59bfedf5] | 77 | <screen><userinput>cvs co cvstest</userinput></screen>
|
---|
[0931098] | 78 |
|
---|
[59bfedf5] | 79 | </sect3>
|
---|
[0931098] | 80 |
|
---|
[59bfedf5] | 81 | <sect3>
|
---|
| 82 | <title>4. Verify Remote Repository Access.</title>
|
---|
[0931098] | 83 |
|
---|
[59bfedf5] | 84 | <para>Test access to the CVS repository from a remote machine using
|
---|
| 85 | a user account that has <command>ssh</command> access to the CVS
|
---|
| 86 | server with the following commands:</para>
|
---|
[0931098] | 87 |
|
---|
[59bfedf5] | 88 | <note>
|
---|
[3cb0c57] | 89 | <para>Replace <replaceable><servername></replaceable> with the
|
---|
[59bfedf5] | 90 | IP address or host name of the CVS repository machine. You will
|
---|
| 91 | be prompted for the user's shell account password before CVS
|
---|
| 92 | checkout can continue.</para>
|
---|
| 93 | </note>
|
---|
[d5c9dbfb] | 94 |
|
---|
[59bfedf5] | 95 | <screen><userinput>export CVS_RSH=/usr/bin/ssh &&
|
---|
[3cb0c57] | 96 | cvs -d:ext:<replaceable><servername></replaceable>:/srv/cvsroot co cvstest</userinput></screen>
|
---|
[0931098] | 97 |
|
---|
[59bfedf5] | 98 | </sect3>
|
---|
[0931098] | 99 |
|
---|
[59bfedf5] | 100 | </sect2>
|
---|
| 101 |
|
---|
| 102 | <sect2 id='cvsserver-config' role="configuration">
|
---|
| 103 | <title>Configuring CVS for Anonymous Read Only Access.</title>
|
---|
| 104 |
|
---|
| 105 | <para>CVS can be set up to allow anonymous read only access using the
|
---|
| 106 | :pserver: method by logging on as <systemitem class="username">root</systemitem>
|
---|
| 107 | and executing the following commands:</para>
|
---|
| 108 |
|
---|
[b785ab29] | 109 | <screen role="root"><userinput>(grep anonymous /etc/passwd || useradd anonymous -s /bin/false -u 98) &&
|
---|
[affc260] | 110 | echo anonymous: > /srv/cvsroot/CVSROOT/passwd &&
|
---|
[59bfedf5] | 111 | echo anonymous > /srv/cvsroot/CVSROOT/readers</userinput></screen>
|
---|
[0931098] | 112 |
|
---|
[efd03f7] | 113 | <!-- <para>If you use <command>inetd</command>, the following command
|
---|
[59bfedf5] | 114 | will add the <application>CVS</application> entry to
|
---|
| 115 | <filename>/etc/inetd.conf</filename>:</para>
|
---|
[0931098] | 116 |
|
---|
[59bfedf5] | 117 | <screen role="root"><userinput>echo "2401 stream tcp nowait root /usr/bin/cvs cvs -f \
|
---|
[efd03f7] | 118 | - -allow-root=/srv/cvsroot pserver" >> /etc/inetd.conf</userinput></screen>
|
---|
[0931098] | 119 |
|
---|
[59bfedf5] | 120 | <indexterm zone="cvsserver cvsserver-config">
|
---|
| 121 | <primary sortas="e-etc-inetd.conf">/etc/inetd.conf</primary>
|
---|
| 122 | </indexterm>
|
---|
[d5c9dbfb] | 123 |
|
---|
[59bfedf5] | 124 | <para>Issue a <command>killall -HUP inetd</command> to reread the changed
|
---|
[0d7900a] | 125 | <filename>inetd.conf</filename> file.</para>
|
---|
[efd03f7] | 126 | -->
|
---|
[59048cd9] | 127 | <!--
|
---|
[59bfedf5] | 128 | <para>If you use <command>xinetd</command>, the following command will create
|
---|
| 129 | the CVS file as <filename>/etc/xinetd.d/cvspserver</filename>:</para>
|
---|
[1f672c1] | 130 |
|
---|
[59bfedf5] | 131 | <screen role="root"><userinput>cat >> /etc/xinetd.d/cvspserver << "EOF"
|
---|
| 132 | <literal># Begin /etc/xinetd.d/cvspserver
|
---|
[0931098] | 133 |
|
---|
| 134 | service cvspserver
|
---|
| 135 | {
|
---|
| 136 | port = 2401
|
---|
| 137 | socket_type = stream
|
---|
| 138 | protocol = tcp
|
---|
| 139 | wait = no
|
---|
| 140 | user = root
|
---|
| 141 | passenv = PATH
|
---|
| 142 | server = /usr/bin/cvs
|
---|
[59048cd9] | 143 | server_args = -f - -allow-root=/srv/cvsroot pserver
|
---|
[0931098] | 144 | }
|
---|
[1f672c1] | 145 |
|
---|
[59bfedf5] | 146 | # End /etc/xinetd.d/cvspserver</literal>
|
---|
| 147 | EOF</userinput></screen>
|
---|
| 148 |
|
---|
| 149 | <indexterm zone="cvsserver cvsserver-config">
|
---|
| 150 | <primary sortas="e-etc-xinetd.d-cvspserver">/etc/xinetd.d/cvspserver</primary>
|
---|
| 151 | </indexterm>
|
---|
| 152 |
|
---|
| 153 | <para>Issue a <command>/etc/rc.d/init.d/xinetd reload</command> to reread
|
---|
| 154 | the changed <filename>xinetd.conf</filename> file.</para>
|
---|
[59048cd9] | 155 | -->
|
---|
[59bfedf5] | 156 | <para>Testing anonymous access to the new repository requires an account
|
---|
| 157 | on another machine that can reach the CVS server via network. No account
|
---|
| 158 | on the CVS repository is needed. To test anonymous access to the CVS
|
---|
| 159 | repository, log in to another machine as an unprivileged user and execute
|
---|
| 160 | the following command:</para>
|
---|
| 161 |
|
---|
[3cb0c57] | 162 | <screen><userinput>cvs -d:pserver:anonymous@<replaceable><servername></replaceable>:/srv/cvsroot co cvstest</userinput></screen>
|
---|
[59bfedf5] | 163 |
|
---|
| 164 | <note>
|
---|
[3cb0c57] | 165 | <para>Replace <replaceable><servername></replaceable> with the
|
---|
[59bfedf5] | 166 | IP address or hostname of the CVS server.</para>
|
---|
| 167 | </note>
|
---|
| 168 |
|
---|
| 169 | </sect2>
|
---|
| 170 |
|
---|
| 171 | <sect2 role="commands">
|
---|
| 172 | <title>Command Explanations</title>
|
---|
| 173 |
|
---|
| 174 | <para><command>mkdir /srv/cvsroot</command>: Create the CVS
|
---|
| 175 | repository directory.</para>
|
---|
| 176 |
|
---|
| 177 | <para><command>chmod 1777 /srv/cvsroot</command>: Set sticky bit
|
---|
| 178 | permissions for <envar>CVSROOT</envar>.</para>
|
---|
| 179 |
|
---|
| 180 | <para><command>export CVSROOT=/srv/cvsroot</command>: Specify new
|
---|
| 181 | <envar>CVSROOT</envar> for all <command>cvs</command> commands.</para>
|
---|
| 182 |
|
---|
| 183 | <para><command>cvs init</command>: Initialize the new CVS
|
---|
| 184 | repository.</para>
|
---|
| 185 |
|
---|
| 186 | <para><command>cvs import -m "repository test" cvstest vendortag
|
---|
| 187 | releasetag</command>: All source code modules must be imported into the
|
---|
| 188 | CVS repository before use, with the <command>cvs import</command> command.
|
---|
| 189 | The <option>-m</option> flags specifies an initial descriptive entry for
|
---|
| 190 | the new module. The <option>cvstest</option> parameter is the name used
|
---|
| 191 | for the module in all subsequent <command>cvs</command> commands. The
|
---|
| 192 | <option>vendortag</option> and <option>releasetag</option> parameters are
|
---|
| 193 | used to further identify each CVS module and are mandatory whether used
|
---|
| 194 | or not.</para>
|
---|
| 195 |
|
---|
| 196 | <para><command>(grep anonymous /etc/passwd || useradd anonymous -s
|
---|
[b785ab29] | 197 | /bin/false -u 98)</command>: Check for an existing <systemitem
|
---|
[59bfedf5] | 198 | class="username">anonymous</systemitem> user and create one if not
|
---|
| 199 | found.</para>
|
---|
| 200 |
|
---|
| 201 | <para><command>echo anonymous: > /srv/cvsroot/CVSROOT/passwd</command>:
|
---|
| 202 | Add the <systemitem class="username">anonymous</systemitem> user to the
|
---|
| 203 | CVS passwd file, which is unused for anything else in this
|
---|
| 204 | configuration.</para>
|
---|
| 205 |
|
---|
| 206 | <para><command>echo anonymous > /srv/cvsroot/CVSROOT/readers</command>:
|
---|
| 207 | Add the <systemitem class="username">anonymous</systemitem> user to the
|
---|
| 208 | CVS readers file, a list of users who have read only access to the
|
---|
| 209 | repository.</para>
|
---|
| 210 |
|
---|
| 211 | </sect2>
|
---|
| 212 |
|
---|
| 213 | <sect2 role="content">
|
---|
| 214 | <title>Contents</title>
|
---|
| 215 |
|
---|
| 216 | <segmentedlist>
|
---|
| 217 | <segtitle>Installed Programs</segtitle>
|
---|
| 218 | <segtitle>Installed Libraries</segtitle>
|
---|
| 219 | <segtitle>Installed Directories</segtitle>
|
---|
| 220 |
|
---|
| 221 | <seglistitem>
|
---|
| 222 | <seg>None</seg>
|
---|
| 223 | <seg>None</seg>
|
---|
| 224 | <seg>/srv/cvsroot</seg>
|
---|
| 225 | </seglistitem>
|
---|
| 226 | </segmentedlist>
|
---|
| 227 |
|
---|
| 228 | </sect2>
|
---|
| 229 |
|
---|
[f45b1953] | 230 | </sect1>
|
---|