Defcon1-Header
Tool-BarfreeBSD ArticlesSearch Our SiteHOMEfreeBSD LinksContribute to FreeBSD HelpFreeBSD FilesFreeBSD Script Corner

Setting up a CVS Server

1 What this tutorial is not
2 Basic CVS Setup
3 Adding anonymous access
4 Adding a project


**Section 1**
 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

**Section 2**
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 :

  user001:adldlad2Dlasd:cvs
  cvs:afnyHNNeNIUaM:cvs
  anoncvs:jNg30LP9shlYI:cvs

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 :

   SystemAuth=no

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.

**Section 3**
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.

**Section 4**
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.

© 1997 - 20013 Defcon1, www.defcon1.org , Copyrights for all materials on this web site are held by the individual authors, artists, photographers or creators. Materials may not be reproduced or otherwise distributed without permission of www.defcon1.org and the content's original author.

Defcon1-Header2
Tool-Bar-2Defcon1  Webmail