Network: Cvs: setting up a cvs server

(last edit: 2001-03-18)

What is cvs?

Cvs stands for Concurrent Version System and it is used for version control. If you want to read more about is then got to www.cvshome.org.

Installing a cvs server:

This is how I always install a cvs server: Make a new group called 'cvsusers' and a new user called 'cvs' and make sure the user cvs can't login to the system (see denying users from the system). Choose a directory in which all the source codes will be stored (also called 'the repository'). I've chosen for /mnt/raid/cvsroot. Make the new dir and make sure it is owned by cvs:cvsusers. Now do the following: server [root] /mnt/raid/cvsroot>cvs -d /mnt/raid/cvsroot init -d CVS_root_directory Use CVS_root_directory as the root directory path- name of the master source repository. Overrides the setting of the CVSROOT environment variable. This value should be specified as an absolute path- name. The 'init' option tells cvs to create a new repository in the specified dir. It will create a directory in which it will create files and scripts wich controll the repository: server [root] /mnt/raid/cvsroot>ls CVSROOT server [root] /mnt/raid/cvsroot>cd CVSROOT/ servr [root] /mnt/raid/cvsroot/CVSROOT>ls .#checkoutlist .#rcsinfo config loginfo,v taginfo,v .#commitinfo .#taginfo config,v modules val-tags .#config .#verifymsg cvswrappers modules,v verifymsg .#cvswrappers Emptydir cvswrappers,v notify verifymsg,v .#editinfo checkoutlist editinfo notify,v .#loginfo checkoutlist,v editinfo,v rcsinfo .#modules commitinfo history rcsinfo,v .#notify commitinfo,v loginfo taginfo Now your cvs server is ready for action and you'll have to give users acces to it. You can do this by adding their names to the group in '/etc/group'. The have rights to access the directory and thus the cvs server when they are memeber of the group 'cvsusers'. There are allot of setting which you can put in evironment variables, read the cvs man page to find out more about them. Because cvs uses a remote login you'll have to enable one on the server. I recomment to use 'ssh' (duh???). Installing and configuring ssh is a complete new 'how-to' so I won't discuss it here. To make thing a bit more easy I recomment to put the following variable in the enviroment 'CVS_RSH' : export CVS_RSH=ssh NOTE: this is bash/zsh syntax This will make sure that cvs will use ssh to login to the cvs server.

Sample session

Here is a sample session: NOTE: 'CVS_RSH=ssh' is in the environment client [root] /root/configfiles/etc/wolf>cvs -d :ext:jappe@server:/mnt/raid/cvsroot import configfiles jappe initial NOTE: the command is broken into two lines due to the length, don't do this in real-life This command will access the cvs server 'server' as user 'jappe' and repository '/mnt/raid/cvsroot. If everything goes oke you'll get to see a vi session in which you have to type some comments about the source youre uploading. After you've saved and exited the vi session your source will be uploaded. You'll find youre files in the repository under [filename],v . If you want to read more about using cvs then please read Using CVS

Errors

--- server: Connection refused cvs [import aborted]: end of file from server (consult above messages if any) --- Sollution: Place the 'CVS_RSH' variable in the environment with your preferred connection method, e.g.: export CVS_RSH=ssh --- Error: '/' access denied (or something like this) --- Sollution: Check ownership and permissions of the cvsroot directory (the one you've chosen and created).

Click here to go back to the index.