Monday, April 18, 2005

How to install CVS server on Linux

[root@micro root]# groupadd cvs
[root@micro root]# useradd -g cvs -d /home/cvsroot cvsadmin
[root@micro root]# passwd cvsadmin
Changing password for user cvsadmin.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
[root@micro root]# su - cvsadmin
[cvsadmin@micro cvsroot]$ more /etc/servicesgrep cvspserver
cvspserver 2401/tcp # CVS client/server operations
cvspserver 2401/udp # CVS client/server operations
[cvsadmin@micro cvsroot]$ chmod 755 .
[cvsadmin@micro cvsroot]$ exit
[root@micro root]# vi /etc/xinetd.d/cvspserver
service cvspserver
{
Port = 2401
socket_type = stream
protocol = tcp
wait = no
user = root
passenv =
server = /usr/bin/cvs
server_args = --allow-root=/home/cvsroot -f pserver
env = HOME=/home/cvsroot
log = /var/log/cvslog
log_on_failure += USERID
}
[cvsadmin@micro cvsroot]$ vi /etc/profile
CVSROOT=/home/cvsroot
export CVSROOT
:wq
[root@micro root]# source /etc/profile
[root@micro root]# cvs init
[root@micro root]# service xinetd restart
OR
[root@micro root]# /etc/rc.d/init.d/ xinetd restart
[root@micro root]# netstat -lnpgrep 2401
tcp 0 0 0.0.0.0:2401 0.0.0.0:* LISTEN 2999/xinetd
[root@micro root]# cvs -d:pserver:cvsadmin@10.220.22.1:/home/cvsroot login
Logging in to :pserver:cvsadmin@10.220.22.1:2401/home/cvsroot CVS password:
[root@micro root]#

Client side:
17) Now go to the client machine and install the Wincvs available from //titan/software/cvs.
18) Open Wincvs window. Go to admin>>preferences.
19) At the enter CVSROOT field enter :pserver:username@cvsserver_name:/home/cvsroot?
20) In the Authentication field select password file on cvs server?
21) Now it is time to create to new modules. In Wincvs client go to Create>>Import module. Select the folder from which you want to create the module.
22) Then in import settings dialog box enter the module name as whatever you want. Mention vendor tag and release tag appropriately. You can also give log message that is associated with this module.
23) Now any other client machine access the same modules
24) To access the modules from other machines, open wincvs client in that machine. Repeat steps 18 and 19.
25) Now click on Admin>>login. It will ask for the password. Supply the correct password.
26) Then go to Create checkout module. In Enter the module name field give the module name you created in the above steps?
27) In the field local folder to checkout to?give the path of the folder wherever you want to put your files.
28) Start using CVS as usual.