Tagged cvsserver.xml

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@4356 af4574ff-66df-0310-9fd7-8a98e5e911e0
This commit is contained in:
Manuel Canales Esparcia 2005-05-18 18:55:21 +00:00
parent 66b825e081
commit 59bfedf5e4

View File

@ -7,109 +7,129 @@
]>
<sect1 id="cvsserver" xreflabel="Running a CVS Server">
<sect1info>
<othername>$LastChangedBy$</othername>
<date>$Date$</date>
</sect1info>
<?dbhtml filename="cvsserver.html"?>
<?dbhtml filename="cvsserver.html"?>
<title>Running a CVS server</title>
<sect1info>
<othername>$LastChangedBy$</othername>
<date>$Date$</date>
</sect1info>
<sect2>
<title>Running a <acronym>CVS</acronym> server</title>
<title>Running a CVS Server</title>
<para>This section will describe how to set up, administer and secure
a <acronym>CVS</acronym> server.</para>
<sect2 role="package">
<title>Running a CVS Server</title>
<sect3>
<title><application>CVS server</application> dependencies</title>
<para>This section will describe how to set up, administer and secure
a CVS server.</para>
<sect4>
<title>Required</title>
<para><xref linkend="cvs"/> and <xref linkend="openssh"/></para></sect4>
</sect3>
<bridgehead renderas="sect3">CVS Server Dependencies</bridgehead>
</sect2>
<bridgehead renderas="sect4">Required</bridgehead>
<para><xref linkend="cvs"/> and
<xref linkend="openssh"/></para>
<sect2>
<title>Setting up a <acronym>CVS</acronym> server.</title>
</sect2>
<para>A <acronym>CVS</acronym> server will be set up using OpenSSH
as the remote access method. Other access methods, including :pserver: and
:server: will not be used for write access to the <acronym>CVS</acronym>
repository. The :pserver: method sends clear text passwords over the network
and the :server: method is not supported in all <acronym>CVS</acronym> ports.
Instructions for anonymous, read only <acronym>CVS</acronym> access using
:pserver: can be found at the end of this section.</para>
<sect2 role="configuration">
<title>Setting up a CVS Server.</title>
<para>Configuration of the <acronym>CVS</acronym> server consists of four
steps:</para>
<para>A CVS server will be set up using OpenSSH as the remote access
method. Other access methods, including :pserver: and :server: will
not be used for write access to the CVS repository. The :pserver:
method sends clear text passwords over the network and the :server:
method is not supported in all CVS ports. Instructions for anonymous,
read only CVS access using :pserver: can be found at the end of this
section.</para>
<sect3><title>1. Create a repository.</title>
<para>Create a new <acronym>CVS</acronym> repository with the following
commands:</para>
<screen><userinput><command>mkdir /srv/cvsroot &amp;&amp;
<para>Configuration of the CVS server consists of four
steps:</para>
<sect3>
<title>1. Create a Repository.</title>
<para>Create a new CVS repository with the following
commands:</para>
<screen role="root"><userinput>mkdir /srv/cvsroot &amp;&amp;
chmod 1777 /srv/cvsroot &amp;&amp;
export CVSROOT=/srv/cvsroot &amp;&amp;
cvs init</command></userinput></screen></sect3>
cvs init</userinput></screen>
<sect3><title>2. Import source code into the repository.</title>
<para>Import a source module into the repository with the following
commands, issued from a user account on the same machine as the
<acronym>CVS</acronym> repository:</para>
</sect3>
<screen><userinput><command>cd <replaceable>[sourcedir]</replaceable> &amp;&amp;
cvs import -m "<replaceable>[repository test]</replaceable>" <replaceable>[cvstest]</replaceable> <replaceable>[vendortag]</replaceable> <replaceable>[releasetag]</replaceable></command></userinput></screen></sect3>
<sect3>
<title>2. Import Source Code Into the Repository.</title>
<sect3><title>3. Verify local repository access.</title>
<para>Test access to the <acronym>CVS</acronym> repository from the same user
account with the following command:</para>
<para>Import a source module into the repository with the following
commands, issued from a user account on the same machine as the
CVS repository:</para>
<screen><userinput><command>cvs co cvstest</command></userinput></screen></sect3>
<screen><userinput>cd <replaceable>[sourcedir]</replaceable> &amp;&amp;
cvs import -m "<replaceable>[repository test]</replaceable>" <replaceable>[cvstest]</replaceable> <replaceable>[vendortag]</replaceable> <replaceable>[releasetag]</replaceable></userinput></screen>
<sect3><title>4. Verify remote repository access.</title>
<para>Test access to the <acronym>CVS</acronym> repository from a remote
machine using a user account that has <command>ssh</command> access to the
<acronym>CVS</acronym> server with the following commands:</para>
<note><para>Replace <replaceable>[servername]</replaceable> with the
<acronym>IP</acronym> address or host name of the <acronym>CVS</acronym>
repository machine. You will be prompted for the user's shell account password
before <acronym>CVS</acronym> checkout can continue.</para></note>
</sect3>
<sect3>
<title>3. Verify Local Repository Access.</title>
<screen><userinput><command>export CVS_RSH=/usr/bin/ssh &amp;&amp;
cvs -d:ext:<replaceable>[servername]</replaceable>:/srv/cvsroot co cvstest</command></userinput></screen></sect3>
</sect2>
<para>Test access to the CVS repository from the same user
account with the following command:</para>
<sect2 id='cvsserver-config'>
<title>Configuring <acronym>CVS</acronym> for anonymous read only access.</title>
<screen><userinput>cvs co cvstest</userinput></screen>
<para><acronym>CVS</acronym> can be set up to allow anonymous read only access
using the :pserver: method by logging on as root and executing the following
commands:</para>
</sect3>
<screen><userinput><command>(grep anonymous /etc/passwd || useradd anonymous -s /bin/false) &amp;&amp;
<sect3>
<title>4. Verify Remote Repository Access.</title>
<para>Test access to the CVS repository from a remote machine using
a user account that has <command>ssh</command> access to the CVS
server with the following commands:</para>
<note>
<para>Replace <replaceable>[servername]</replaceable> with the
IP address or host name of the CVS repository machine. You will
be prompted for the user's shell account password before CVS
checkout can continue.</para>
</note>
<screen><userinput>export CVS_RSH=/usr/bin/ssh &amp;&amp;
cvs -d:ext:<replaceable>[servername]</replaceable>:/srv/cvsroot co cvstest</userinput></screen>
</sect3>
</sect2>
<sect2 id='cvsserver-config' role="configuration">
<title>Configuring CVS for Anonymous Read Only Access.</title>
<para>CVS can be set up to allow anonymous read only access using the
:pserver: method by logging on as <systemitem class="username">root</systemitem>
and executing the following commands:</para>
<screen role="root"><userinput>(grep anonymous /etc/passwd || useradd anonymous -s /bin/false) &amp;&amp;
echo anonymous: &gt; /srv/cvsroot/CVSROOT/passwd &amp;&amp;
echo anonymous &gt; /srv/cvsroot/CVSROOT/readers</command></userinput></screen>
echo anonymous &gt; /srv/cvsroot/CVSROOT/readers</userinput></screen>
<para>If you use <command>inetd</command>, the following command will add the
<application><acronym>CVS</acronym></application> entry to <filename>/etc/inetd.conf</filename>:</para>
<para>If you use <command>inetd</command>, the following command
will add the <application>CVS</application> entry to
<filename>/etc/inetd.conf</filename>:</para>
<screen><userinput><command>echo "2401 stream tcp nowait root /usr/bin/cvs cvs -f \
--allow-root=/srv/cvsroot pserver" &gt;&gt; /etc/inetd.conf</command></userinput></screen>
<screen role="root"><userinput>echo "2401 stream tcp nowait root /usr/bin/cvs cvs -f \
--allow-root=/srv/cvsroot pserver" &gt;&gt; /etc/inetd.conf</userinput></screen>
<indexterm zone="cvsserver cvsserver-config">
<primary sortas="e-etc-inetd.conf">/etc/inetd.conf</primary>
</indexterm>
<indexterm zone="cvsserver cvsserver-config">
<primary sortas="e-etc-inetd.conf">/etc/inetd.conf</primary>
</indexterm>
<para>Issue a <command>killall -HUP inetd</command> to reread the changed
<filename>inetd.conf</filename> file.</para>
<para>Issue a <command>killall -HUP inetd</command> to reread the changed
<filename>inetd.conf</filename> file.</para>
<para>If you use <command>xinetd</command>, the following command will create the
<acronym>CVS</acronym> file as <filename>/etc/xinetd.d/cvspserver</filename>:</para>
<para>If you use <command>xinetd</command>, the following command will create
the CVS file as <filename>/etc/xinetd.d/cvspserver</filename>:</para>
<screen><userinput><command>cat &gt;&gt; /etc/xinetd.d/cvspserver &lt;&lt; "EOF"</command>
# Begin /etc/xinetd.d/cvspserver
<screen role="root"><userinput>cat &gt;&gt; /etc/xinetd.d/cvspserver &lt;&lt; "EOF"
<literal># Begin /etc/xinetd.d/cvspserver
service cvspserver
{
@ -123,84 +143,88 @@ echo anonymous &gt; /srv/cvsroot/CVSROOT/readers</command></userinput></screen>
server_args = -f --allow-root=/srv/cvsroot pserver
}
# End /etc/xinetd.d/cvspserver
<command>EOF</command></userinput></screen>
# End /etc/xinetd.d/cvspserver</literal>
EOF</userinput></screen>
<indexterm zone="cvsserver cvsserver-config">
<primary sortas="e-etc-xinetd.d-cvspserver">/etc/xinetd.d/cvspserver</primary>
</indexterm>
<indexterm zone="cvsserver cvsserver-config">
<primary sortas="e-etc-xinetd.d-cvspserver">/etc/xinetd.d/cvspserver</primary>
</indexterm>
<para>Issue a <command>/etc/rc.d/init.d/xinetd reload</command> to reread the changed
<filename>xinetd.conf</filename> file.</para>
<para>Issue a <command>/etc/rc.d/init.d/xinetd reload</command> to reread
the changed <filename>xinetd.conf</filename> file.</para>
<para>Testing anonymous access to the new repository requires an account
on another machine that can reach the <acronym>CVS</acronym> server via
network. No account on the <acronym>CVS</acronym> repository is needed. To
test anonymous access to the <acronym>CVS</acronym> repository, log in to
another machine as an unprivileged user and execute the following command:
</para>
<para>Testing anonymous access to the new repository requires an account
on another machine that can reach the CVS server via network. No account
on the CVS repository is needed. To test anonymous access to the CVS
repository, log in to another machine as an unprivileged user and execute
the following command:</para>
<screen><userinput><command>cvs -d:pserver:anonymous@<replaceable>[servername]</replaceable>:/srv/cvsroot co cvstest</command></userinput></screen>
<screen><userinput>cvs -d:pserver:anonymous@<replaceable>[servername]</replaceable>:/srv/cvsroot co cvstest</userinput></screen>
<note><para>Replace <replaceable>[servername]</replaceable> with the
<acronym>IP</acronym> address or hostname of the
<acronym>CVS</acronym> server.</para></note>
<note>
<para>Replace <replaceable>[servername]</replaceable> with the
IP address or hostname of the CVS server.</para>
</note>
</sect2>
</sect2>
<sect2>
<title>Command explanations</title>
<sect2 role="commands">
<title>Command Explanations</title>
<para><command>mkdir /srv/cvsroot</command>: Create the <acronym>CVS</acronym>
repository directory.</para>
<para><command>mkdir /srv/cvsroot</command>: Create the CVS
repository directory.</para>
<para><command>chmod 1777 /srv/cvsroot</command>: Set sticky bit permissions for
<envar>CVSROOT</envar>.</para>
<para><command>chmod 1777 /srv/cvsroot</command>: Set sticky bit
permissions for <envar>CVSROOT</envar>.</para>
<para><command>export CVSROOT=/srv/cvsroot</command>: Specify new <envar>CVSROOT
</envar> for all <command>cvs</command> commands.</para>
<para><command>export CVSROOT=/srv/cvsroot</command>: Specify new
<envar>CVSROOT</envar> for all <command>cvs</command> commands.</para>
<para><command>cvs init</command>: Initialize the new <acronym>CVS</acronym>
repository.</para>
<para><command>cvs init</command>: Initialize the new CVS
repository.</para>
<para><command>cvs import -m "repository test" cvstest vendortag
releasetag</command>: All source code modules must be imported
into the <acronym>CVS</acronym> repository before use, with the
<command>cvs import</command> command. The <userinput>-m</userinput>
flags specifies an initial descriptive entry for the new module.
The "cvstest" parameter is the name used for the module in all
subsequent <command>cvs</command> commands. The "vendortag" and "releasetag"
parameters are used to further identify each <acronym>CVS</acronym> module and
are mandatory whether used or not.</para>
<para><command>cvs import -m "repository test" cvstest vendortag
releasetag</command>: All source code modules must be imported into the
CVS repository before use, with the <command>cvs import</command> command.
The <option>-m</option> flags specifies an initial descriptive entry for
the new module. The <option>cvstest</option> parameter is the name used
for the module in all subsequent <command>cvs</command> commands. The
<option>vendortag</option> and <option>releasetag</option> parameters are
used to further identify each CVS module and are mandatory whether used
or not.</para>
<para><command>(grep anonymous /etc/passwd || useradd anonymous -s
/bin/false)</command>: Check for an existing anonymous user and
create one if not found.</para>
<para><command>(grep anonymous /etc/passwd || useradd anonymous -s
/bin/false)</command>: Check for an existing <systemitem
class="username">anonymous</systemitem> user and create one if not
found.</para>
<para><command>echo anonymous: &gt; /srv/cvsroot/CVSROOT/passwd
</command>: Add the anonymous user to the <acronym>CVS</acronym> passwd file,
which is unused for anything else in this configuration.</para>
<para><command>echo anonymous: &gt; /srv/cvsroot/CVSROOT/passwd</command>:
Add the <systemitem class="username">anonymous</systemitem> user to the
CVS passwd file, which is unused for anything else in this
configuration.</para>
<para><command>echo anonymous &gt; /srv/cvsroot/CVSROOT/readers</command>: Add the
anonymous user to the <acronym>CVS</acronym> readers file, a list of
users who have read only access to the repository.</para>
<para><command>echo anonymous &gt; /srv/cvsroot/CVSROOT/readers</command>:
Add the <systemitem class="username">anonymous</systemitem> user to the
CVS readers file, a list of users who have read only access to the
repository.</para>
</sect2>
</sect2>
<sect2 role="content">
<title>Contents</title>
<segmentedlist>
<segtitle>Installed Programs</segtitle>
<segtitle>Installed Libraries</segtitle>
<segtitle>Installed Directories</segtitle>
<seglistitem>
<seg>None</seg>
<seg>None</seg>
<seg>/srv/cvsroot</seg>
</seglistitem>
</segmentedlist>
</sect2>
<sect2>
<title>Contents</title>
<segmentedlist>
<segtitle>Installed Programs</segtitle>
<segtitle>Installed Libraries</segtitle>
<segtitle>Installed Directories</segtitle>
<seglistitem>
<seg>None</seg>
<seg>None</seg>
<seg>/srv/cvsroot</seg>
</seglistitem>
</segmentedlist>
</sect2>
</sect1>