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