[dcc89bf1] | 1 | <sect2>
|
---|
| 2 | <title>Setting up a CVS server.</title>
|
---|
| 3 |
|
---|
| 4 | <para>We will discuss setting up a CVS server using OpenSSH as the
|
---|
| 5 | remote access method. Other access methods, including :pserver: and
|
---|
| 6 | :server: will not be used for write access to the CVS repository. The
|
---|
| 7 | :pserver: method sends clear text passwords over the network and the
|
---|
| 8 | :server: method is not supported in all CVS ports. Instructions for
|
---|
| 9 | anonymous, read only CVS access using :pserver: can be found at the
|
---|
| 10 | end of this section.</para>
|
---|
| 11 |
|
---|
| 12 | <para>Configuration of our CVS server consists of four steps:</para>
|
---|
| 13 |
|
---|
| 14 | <sect3><title>1. Create a repository.</title>
|
---|
| 15 | <para>Create a new CVS repository with the following commands,
|
---|
| 16 | logged in as root:</para>
|
---|
[7319b78] | 17 | <para><screen><userinput>mkdir /cvsroot &&
|
---|
[dcc89bf1] | 18 | chmod 1777 /cvsroot &&
|
---|
| 19 | export CVSROOT=/cvsroot
|
---|
| 20 | cvs init</userinput></screen></para></sect3>
|
---|
| 21 |
|
---|
| 22 | <sect3><title>2. Import source code into the repository.</title>
|
---|
| 23 | <para>Import a source module into the repository with the following
|
---|
| 24 | commands, issued from a user account on the same machine as the CVS
|
---|
| 25 | repository:</para>
|
---|
| 26 |
|
---|
[7319b78] | 27 | <para><screen><userinput>export CVSROOT=/cvsroot &&
|
---|
[dcc89bf1] | 28 | cd sourcedir &&
|
---|
[7319b78] | 29 | cvs import -m "repository test" cvstest vendortag releasetag</userinput></screen></para></sect3>
|
---|
[dcc89bf1] | 30 |
|
---|
| 31 | <sect3><title>3. Verify local repository access.</title>
|
---|
| 32 | <para>Test access to the CVS repository from the same user account
|
---|
| 33 | with the following command:</para>
|
---|
| 34 |
|
---|
[7319b78] | 35 | <para><screen><userinput>cvs co cvstest</userinput></screen></para></sect3>
|
---|
[dcc89bf1] | 36 |
|
---|
| 37 | <sect3><title>4. Verify remote repository access.</title>
|
---|
| 38 | <para>Test access to the CVS repository from a remote machine using a
|
---|
| 39 | user account that has ssh access to the CVS server with the following
|
---|
| 40 | commands:
|
---|
| 41 | <note><para>Replace "servername" with the IP address or host name
|
---|
| 42 | ofthe CVS repository machine. You will be prompted for the user's
|
---|
| 43 | shellaccount password before CVS checkout can
|
---|
| 44 | continue.</para></note></para>
|
---|
| 45 |
|
---|
| 46 |
|
---|
[7319b78] | 47 | <para><screen><userinput>export CVS_RSH=/usr/bin/ssh &&
|
---|
| 48 | cvs -d:ext:servername:/cvsroot co cvstest</userinput></screen></para></sect3>
|
---|
[dcc89bf1] | 49 | </sect2>
|
---|
| 50 | <sect2>
|
---|
| 51 | <title>Configuring CVS for anonymous read only access.</title>
|
---|
| 52 |
|
---|
| 53 | <para>CVS can be set up to allow anonymous read only access using the
|
---|
| 54 | :pserver: method by logging on as root and executing the following
|
---|
| 55 | commands:</para>
|
---|
| 56 |
|
---|
[7319b78] | 57 | <para><screen><userinput>(grep anonymous /etc/passwd || useradd anonymous -s /bin/false) &&
|
---|
[dcc89bf1] | 58 | echo anonymous: > /cvsroot/CVSROOT/passwd &&
|
---|
[7319b78] | 59 | echo anonymous > /cvsroot/CVSROOT/readers</userinput></screen></para>
|
---|
[dcc89bf1] | 60 |
|
---|
| 61 | <para>If you use inetd, the following command will add the pserver
|
---|
| 62 | entry to /etc/inetd.conf:</para>
|
---|
| 63 |
|
---|
[7319b78] | 64 | <para><screen><userinput>echo "2401 stream tcp nowait root /usr/bin/cvs cvs -f \
|
---|
| 65 | --allow-root=/cvsroot pserver" >> /etc/inetd.conf</userinput></screen></para>
|
---|
[dcc89bf1] | 66 |
|
---|
| 67 | <para>Issue a killall -HUP inetd to reread the changed inetd.conf
|
---|
| 68 | file.</para>
|
---|
| 69 |
|
---|
| 70 | <para>If you use xinetd, the following command will add the pserver
|
---|
| 71 | entry to /etc/xinetd.conf:</para>
|
---|
| 72 |
|
---|
[7319b78] | 73 | <para><screen><userinput>cat >> /etc/xinetd.conf << "EOF"
|
---|
[dcc89bf1] | 74 | service cvspserver
|
---|
| 75 | {
|
---|
| 76 | port = 2401
|
---|
| 77 | socket_type = stream
|
---|
| 78 | protocol = tcp
|
---|
| 79 | wait = no
|
---|
| 80 | user = root
|
---|
| 81 | passenv = PATH
|
---|
| 82 | server = /usr/bin/cvs
|
---|
| 83 | server_args = -f --allow-root=/cvsroot pserver
|
---|
| 84 | }
|
---|
[7319b78] | 85 | EOF</userinput></screen></para>
|
---|
[dcc89bf1] | 86 | <para>Issue a killall -HUP xinetd to reread the changed xinetd.conf
|
---|
| 87 | file.</para>
|
---|
| 88 |
|
---|
| 89 | <para>Testing anonymous access to the new repository requires an account
|
---|
| 90 | on another machine that can reach the CVS server via network. No
|
---|
| 91 | account on the CVS repository is needed. To test anonymous access to
|
---|
| 92 | the CVS repository log in to another machine as an unprivileged user
|
---|
| 93 | and execute the following command:</para>
|
---|
| 94 |
|
---|
[7319b78] | 95 | <para><screen><userinput>cvs -d:pserver:anonymous@servername:/cvsroot co cvstest</userinput></screen><note><para>Replace "servername" with the IP
|
---|
[dcc89bf1] | 96 | address or hostname of the CVS server</para></note></para>
|
---|
| 97 |
|
---|
| 98 | </sect2>
|
---|
| 99 |
|
---|
| 100 |
|
---|