<TABLE BORDER=0 CELLSPACING=20 CELLPADDING=10 WIDTH="90%">
<TR>
<TD>
<CENTER>
<B>HOW TO CREATE A
</B><A HREF="http://www.cvshome.org/"><B>CVS
</B></A><B>
SERVER USING
</B><A HREF="http://fedoraproject.org/wiki/"><B>Fedora Core
</B></A>
</CENTER>
<P>There seems to be a severe lack of step-by-step
instructions on how to setup a
<A HREF="http://www.cvshome.org/">CVS
</A>
server using the
<A HREF="http://www.cvshome.org/">Concurrent
Versions System
</A>. The available documentation is sparse
and less than complete. I have included a list of the books
that are most useful for setting up a CVS server at the
bottom of this page. This page does not attempt to explain
how to use
<A HREF="http://www.cvshome.org/">CVS
</A>, there
is plenty of documentation already available for using CVS.
This page instead is designed to give you step-by-step
instructions on how to set up such a server. The
instructions here assume you are using Red Hat Linux 6.1. If
you are using a different distribution of Linux, then the
procedure may be slightly different than the one listed
here. The following procedure assumes you want to use
pserver as your authentication method and not one of the
other methods such as rsh, ssh, or Kerberos which are more
complicated and not covered here. So in a nutshell, here are
the steps to follow to get a
<A HREF="http://www.cvshome.org/">CVS
</A>
server up and running. This procedure requires many detailed
and tedious steps so take your time and be sure to follow
each step exactly:
</P>
<P>Since Linux by default uses bash, all the examples
presented here use that shell also. Feel free to use any
text editor you like to edit the files. This setup document
assumes you already know how to open files, edit them, and
save them in Linux. All examples here use the
<B>emacs
</B>
editor for editing files. All text shown in
<B>Courier
bold
</B> should be entered exactly as shown below, with the
exception of replacing items in brackets (
<>) with
real names or pathnames.
</P>
<P>4) First, you need to decide which directory you want to
store your CVS repository in. In all of the examples here we
will store it in an empty directory we made at the root of
the server named "
<B>repository
</B>". If you don't have this
directory on your server, make one at the root by switching
the current directory to
<B>root
</B> and then typing:
</P>
<P><B>mkdir repository
</B></P>
<P>(you might need to be logged in as
<B>root
</B> in order
to do this).
</P>
<P>When you perform the following steps, it is best if you
are logged in as
<B> root
</B> or
<B>su
</B> (superuser).
Assuming you have done that, type the following command at
the root at the command prompt:
</P>
<P><B>cd etc
</B></P>
<P>and press return.
</P>
<P>5) The first step is to add a variable to the
<B>profile
</B> file in the
<B>etc
</B> directory which will
tell the CVS server where your repository is located. This
environment variable is called
<B>CVSROOT
</B>. So type:
</P>
<P><B>emacs profile
</B></P>
<P>and press return to open the file. Scroll down towards
the bottom of the file and insert the following three
lines:
</P>
<P><B>CVSROOT=/repository/
</B></P>
<P><B>export CVSROOT
</B></P>
<P><B>export EDITOR=emacs
</B></P>
<P>The
<B>export EDITOR
</B> command is optional and can be
omitted. It is mainly used to tell CVS which editor to open
when it needs to get a checkin comment. If you will be using
a GUI CVS client on Windows or Macintosh, you may omit this
line. When finished, save the
<B>profile
</B> file (Control-x
Control-s in emacs) and quit the editor (Control-X Control-c
in emacs).
</P>
<P>6) Next, you will need to add the following lines to the
following files exactly as they are listed below. Where
names of your users or directories are to be inserted, those
names are indicated by
<>. You should replace such
instances with the proper names, but the edited files
themselves should not have the brackets inserted into them.
In other words, the brackets are only shown in this document
in order to indicate that a real name is needed in those
locations. Also, do not put quotes around any inserted names
unless indicated by quotes here.
</P>
<P><B>emacs /etc/services
</B> -add:
</P>
<P><B>cvspserver 2401/tcp
</B> (if not already present)
</P>
<P><B>emacs /etc/group
</B> -add:
</P>
<P><B>cvs:*:105:
<userName1
>,
<userName2
></B></P>
<P>(These names should match exactly user names on the
system and in
<B>/etc/shadow
</B>)
</P>
<P><B>/etc/inetd.conf
</B> - add:
</P>
<P><B>cvspserver stream tcp nowait root /usr/bin/cvs cvs
--allow-root=/repository pserver
</B></P>
<P>Be sure to note that this entry does *not* have a
trailing slash at the end.
</P>
<P>Some Linux systems will require an environment variable
to be set thusly:
</P>
<P><B>cvspserver stream tcp nowait root /usr/bin/env env -i
/usr/bin/cvs -f --allow-root=/repository pserver
</B></P>
<P>If for some reason on your client system you get errors
like "Connection reset by peer", then you can try this
alternate line in the same file (instead of the line
above):
</P>
<P><B>cvspserver stream tcp nowait root /usr/local/bin/cvs
cvs -T/tmp -f --allow-root=/u01/repository pserver
</B></P>
<P>7) Next, navigate back to root and type:
</P>
<P><B>cvs -d /repository init
</B></P>
<P>This will create the initial repository in
<B>/repository/CVSROOT/
</B></P>
<P>8) The next part is a little tricky, but it is not too
hard to accomplish. It involves setting up passwords for the
pserver, CVS's own server authentication method. This step
assumes that you have already set up user accounts and
system passwords for each user you want to have access to
the CVS server as well as having entered those users into
the
<B>/etc/groups
</B> file as listed in step 6 above. So
assuming that that has been done,
<B> cd
</B> to the
<B>/etc
</B> directory and type:
</P>
<P><B>cp shadow /
<full repository
path
>/CVSROOT/passwd
</B></P>
<P>In the
<B>/etc
</B> directory, there is a file named
<B>shadow
</B>. This file contains all the real system
passwords for the system along with a list of users
associated with those passwords. CVS's pserver uses a
similar password syntax to
<B>shadow
</B> except that it
expects to look for these passwords in a file named
<B>passwd
</B> in the repository's
<B>CVSROOT
</B> directory.
Executing the above line simply makes a copy of the
<B>shadow
</B> file from
<B>/etc
</B> into the repository's
directory and renames it to
<B>passwd
</B>. However, we are
not quite done with the
<B>passwd
</B> file just yet.
</P>
<P>9) Next,
<B>cd
</B> to
<B>/repository
</B>and type:
</P>
<P><B>chgrp -R cvs .
</B></P>
<P><B>chmod ug+rwx . CVSROOT
</B></P>
<P>This will set the permissions on all the files in
<B>CVSROOT
</B> to the cvs group.
</P>
<P> </P>
<P>10) Next,
<B>cd
</B> to
<B>/repository/CVSROOT
</B>and
type:
</P>
<P><B>emacs passwd
</B></P>
<P>This will open the
<B> passwd
</B> file for editing. When
you open it, you will see something like the following:
</P>
<P><B>root:$1$KT4ZOG9O$4M1fgufImqfuj0K/XpuIg1:11061:0:99999:7:-1:-1:134549444
</B></P>
<P><B>bin:*:11060:0:99999:7:::
</B></P>
<P><B>daemon:*:11060:0:99999:7:::
</B></P>
<P><B>adm:*:11060:0:99999:7:::
</B></P>
<P><B>lp:*:11060:0:99999:7:::
</B></P>
<P><B>sync:*:11060:0:99999:7:::
</B></P>
<P><B>shutdown:*:11060:0:99999:7:::
</B></P>
<P><B>halt:*:11060:0:99999:7:::
</B></P>
<P><B>mail:*:11060:0:99999:7:::
</B></P>
<P><B>news:*:11060:0:99999:7:::
</B></P>
<P><B>uucp:*:11060:0:99999:7:::
</B></P>
<P><B>operator:*:11060:0:99999:7:::
</B></P>
<P><B>games:*:11060:0:99999:7:::
</B></P>
<P>