source: server/other/cvsserver.xml@ 6b267c3a

10.0 10.1 11.0 6.0 6.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 ken/refactor-virt krejzi/svn lazarus nosym perl-modules qt5new systemd-11177 systemd-13485 trunk xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since 6b267c3a was 6b267c3a, checked in by Igor Živković <igor@…>, 17 years ago

Fixed a typo in CVS server instructions.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@2580 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 7.2 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3 "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7]>
8
9<sect1 id="cvsserver" xreflabel="Running a CVS Server">
10<?dbhtml filename="cvsserver.html"?>
11<title>Running a CVS server</title>
12
13<sect2>
14<title>Running a <acronym>CVS</acronym> server</title>
15
16<para>This section will describe how to set up, administer and secure
17a <acronym>CVS</acronym> server.</para>
18
19<sect3><title><application>CVS server</application> dependencies</title>
20<sect4><title>Required</title>
21<para><xref linkend="cvs"/> and <xref linkend="openssh"/></para></sect4>
22</sect3>
23
24</sect2>
25
26<sect2>
27<title>Setting up a <acronym>CVS</acronym> server.</title>
28
29<para>A <acronym>CVS</acronym> server will be set up using OpenSSH
30as the remote access method. Other access methods, including :pserver: and
31:server: will not be used for write access to the <acronym>CVS</acronym>
32repository. The :pserver: method sends clear text passwords over the network
33and the :server: method is not supported in all <acronym>CVS</acronym> ports.
34Instructions for anonymous, read only <acronym>CVS</acronym> access using
35:pserver: can be found at the end of this section.</para>
36
37<para>Configuration of the <acronym>CVS</acronym> server consists of four
38steps:</para>
39
40<sect3><title>1. Create a repository.</title>
41<para>Create a new <acronym>CVS</acronym> repository with the following
42commands:</para>
43<screen><userinput><command>mkdir /home/cvsroot &amp;&amp;
44chmod 1777 /home/cvsroot &amp;&amp;
45export CVSROOT=/home/cvsroot &amp;&amp;
46cvs init</command></userinput></screen></sect3>
47
48<sect3><title>2. Import source code into the repository.</title>
49<para>Import a source module into the repository with the following
50commands, issued from a user account on the same machine as the
51<acronym>CVS</acronym> repository:</para>
52
53<screen><userinput><command>export CVSROOT=/home/cvsroot &amp;&amp;
54cd <replaceable>[sourcedir]</replaceable> &amp;&amp;
55cvs import -m <replaceable>["repository test"] [cvstest] [vendortag] [releasetag]</replaceable></command></userinput></screen></sect3>
56
57<sect3><title>3. Verify local repository access.</title>
58<para>Test access to the <acronym>CVS</acronym> repository from the same user
59account with the following command:</para>
60
61<screen><userinput><command>cvs co cvstest</command></userinput></screen></sect3>
62
63<sect3><title>4. Verify remote repository access.</title>
64<para>Test access to the <acronym>CVS</acronym> repository from a remote
65machine using a user account that has <command>ssh</command> access to the
66<acronym>CVS</acronym> server with the following commands:</para>
67<note><para>Replace <replaceable>[servername]</replaceable> with the
68<acronym>IP</acronym> address or host name of the <acronym>CVS</acronym>
69repository machine. You will be prompted for the user's shell account password
70before <acronym>CVS</acronym> checkout can continue.</para></note>
71
72
73<screen><userinput><command>export CVS_RSH=/usr/bin/ssh &amp;&amp;
74cvs -d:ext:<replaceable>[servername]</replaceable>:/cvsroot co cvstest</command></userinput></screen></sect3>
75</sect2>
76<sect2>
77<title>Configuring <acronym>CVS</acronym> for anonymous read only access.</title>
78
79<para><acronym>CVS</acronym> can be set up to allow anonymous read only access
80using the :pserver: method by logging on as root and executing the following
81commands:</para>
82
83<screen><userinput><command>(grep anonymous /etc/passwd || useradd anonymous -s /bin/false) &amp;&amp;
84echo anonymous: &gt; /home/cvsroot/CVSROOT/passwd &amp;&amp;
85echo anonymous &gt; /home/cvsroot/CVSROOT/readers</command></userinput></screen>
86
87<para>If you use <command>inetd</command>, the following command will add the
88pserver entry to <filename>/etc/inetd.conf</filename>:</para>
89
90<screen><userinput><command>echo "2401 stream tcp nowait root /usr/bin/cvs cvs -f \
91 --allow-root=/home/cvsroot pserver" &gt;&gt; /etc/inetd.conf</command></userinput></screen>
92
93<para>Issue a <command>killall -HUP inetd</command> to reread the changed
94<filename>inetd.conf</filename> file.</para>
95
96<para>If you use <command>xinetd</command>, the following command will add the
97pserver entry to <filename>/etc/xinetd.conf</filename>:</para>
98
99<screen><userinput><command>cat &gt;&gt; /etc/xinetd.conf &lt;&lt; "EOF"</command>
100 service cvspserver
101 {
102 port = 2401
103 socket_type = stream
104 protocol = tcp
105 wait = no
106 user = root
107 passenv = PATH
108 server = /usr/bin/cvs
109 server_args = -f --allow-root=/home/cvsroot pserver
110 }
111<command>EOF</command></userinput></screen>
112<para>Issue a <command>/etc/rc.d/init.d/xinetd reload</command> to reread the changed
113<filename>xinetd.conf</filename> file.</para>
114
115<para>Testing anonymous access to the new repository requires an account
116on another machine that can reach the <acronym>CVS</acronym> server via
117network. No account on the <acronym>CVS</acronym> repository is needed. To
118test anonymous access to the <acronym>CVS</acronym> repository, log in to
119another machine as an unprivileged user and execute the following command:
120</para>
121
122<screen><userinput><command>cvs -d:pserver:anonymous@<replaceable>[servername]</replaceable>:/home/cvsroot co cvstest</command></userinput></screen>
123<note><para>Replace <replaceable>[servername]</replaceable> with the <acronym>IP</acronym> address or
124hostname of the <acronym>CVS</acronym> server</para></note>
125
126</sect2>
127
128<sect2>
129<title>Command explanations</title>
130
131<para><command>mkdir /home/cvsroot</command>: Create the <acronym>CVS</acronym>
132repository directory.</para>
133
134<para><command>chmod 1777 /home/cvsroot</command>: Set sticky bit permissions for
135<envar>CVSROOT</envar>.</para>
136
137<para><command>export CVSROOT=/home/cvsroot</command>: Specify new <envar>CVSROOT
138</envar> for all <command>cvs</command> commands.</para>
139
140<para><command>cvs init</command>: Initialize the new <acronym>CVS</acronym>
141repository.</para>
142
143<para><command>cvs import -m "repository test" cvstest vendortag
144releasetag</command>: All source code modules must be imported
145into the <acronym>CVS</acronym> repository before use, with the
146<command>cvs import</command> command. The <userinput>-m</userinput>
147flags specifies an initial descriptive entry for the new module.
148The "cvstest" parameter is the name used for the module in all
149subsequent <command>cvs</command> commands. The "vendortag" and "releasetag"
150parameters are used to further identify each <acronym>CVS</acronym> module and
151are mandatory whether used or not.</para>
152
153<para><command>(grep anonymous /etc/passwd || useradd anonymous -s
154/bin/false)</command>: Check for an existing anonymous user and
155create one if not found.</para>
156
157<para><command>echo anonymous: &gt; /home/cvsroot/CVSROOT/passwd
158</command>: Add the anonymous user to the <acronym>CVS</acronym> passwd file,
159which is unused for anything else in this configuration.</para>
160
161<para><command>echo anonymous &gt; /home/cvsroot/CVSROOT/readers</command>: Add the
162anonymous user to the <acronym>CVS</acronym> readers file, a list of
163users who have read only access to the repository.</para>
164
165</sect2>
166
167</sect1>
168
Note: See TracBrowser for help on using the repository browser.