Setting up a CVS Server
1 What this tutorial is not
2 Basic CVS Setup
3 Adding anonymous access
4 Adding a project
First and foremost, this is a tutorial on how to set up your own CVS server. It is NOT a CVS usuage tutorial, thats what the CVS man pages are for. In saying that, lets move on
The first step in creating a CVS repository is giving it a home. In my case I chose to use /home/cvs. Any filesystem is fine, just make sure it has lots of free space.
# mkdir /home/cvs
Next, you will want to create a cvs user and group. I ran adduser and made a user named "cvs" and a group named "cvs". This will be used again at a later time. It is a good idea to give the cvs user a nonexistent shell so they can't login, and also there is no need to copy the dotfiles.
Next, it is time to get the cvs up and running. Set the enviromental varablie CVSROOT to the dirctory where cvs will live. For sh shells (sh, bash):
# export CVSROOT="/home/cvs"
for csh shells (csh, tcsh) :
# setenv CVSROOT /home/cvs
Then, we will initilize the repository
# cvs init
Next, we want to get the repository listening to network requests. Add this
line to inetd.conf and restart inetd :
cvspserver stream tcp nowait root /usr/bin/cvs cvs --allow-root=/home/cvs pserver
It actually should already be there, only commented. Restart inetd :
# killall -1 inetd
Next, we need to create a password file. The best utility to do this is the htpasswd utility distibuted with the apache web server. I.E. :
# htpasswd -c /home/cvs/passwd user001
The name of the password file must not change, this is where CVS will look to find users that have access to the repository. When you have created the file, it should look like this :
the first field is the user name, the second is a "crypt"ed password, and the third is the UID of the cvs user you created in step 2.
Next, make a temporary directory and check out CVSROOT. Edit the config file. Make sure that this field is there :
This tells CVS to use only it's passwd file, not /etc/passwd as a backup. Then, commit those changes. Also at this point you may want to change the CVSROOT varibale to point at :
# setenv CVSROOT :pserver:user001@localhost:/home/cvs
Thats all that is needed to set up CVS. The modules file is a tab delimieted file mapping repository subdirectorys to module names. It is not nessasary, but is very helpful.
To set up anonymous cvs access, create the file /home/cvs/CVSROOT/readers (not through CVS, do it locally.) and place the user names of those that have read only access into it.
To add a project, use the cvs import command in the main directory of the project you want to add. I.E. :
# cd /path/to/my/project
# cvs import -m "Initial Import" NAMEOFMODULEONCVS TAG1 TAG2
Thats all there is to it, see "man cvs" for more info.