Here are some handy instructions for setting up a CVS server. I’m really posting them for my own benefit, but perhaps this will help someone else out there. I’ll be posting a follow up sometime with a walk-through of basic cvs use.
Server Setup
- .On your Red Hat 7.1 or higher box (I recommend this because it’s what I’ve used), make sure cvs is installed. If it’s not, get it and install it.
- .Decide where you’re going to put CVS. I installed it in /home/cvs/cvs
- .Edit the file
/root/.bash_profile
and add the variable
CVSROOT=/home/cvs/cvs
as well as adding
CVSROOT
to the list of variables in the export list.
- .At the prompt, type:
$CVSROOT
- .The console should return:
/home/cvs/cvs is a directory
- .If it doesn’t, at the prompt, type:
export CVSROOT=/home/cvs/cvs
- .Go to the directory you want to be the repository (i.e.
/home/cvs/cvs
). Once inside, at the prompt, type:
cvs init
- .This will create a folder within your repository called
CVSROOT
. Enter that directory.
- .Now we will set up users. For the first user, type:
htpasswd -c passwd username
- .You will be prompted to enter the user’s password. Make sure you remember it.
- .For each additional user, type:
htpasswd passwd username
- .For each additional user, you’ll enter a password.
- .Edit the file
passwd
where you will see each user in the following format: username:scrambled password. Add to the end of each one :projectname so that each user is now username:scrambledpassword:projectname
- .Make a new file in
/etc/xinetd.d/
called
cvspserver
- .In that file, put the following:
# CVS configuration for xinetd don't forget to specify your CVSROOT in # /etc/cvs/cvs.conf. service cvspserver { disable = no socket_type = stream protocol = tcp wait = no user = root server =/usr/bin/cvs server_args = -f --allow-root=/home/cvs/cvs pserver log_type = SYSLOG authpriv log_on_success = HOST PID log_on_failure = HOST }
- .Restart the xinetd service.
- .Run
netstat -pant
to see if the server is now listening on port 2401.