Difference between revisions of "CVS Server"

From ArchWiki
Jump to: navigation, search
m (request merge with Concurrent Versions System)
 
Line 1: Line 1:
{{i18n|CVS Server}}
+
#REDIRECT [[Concurrent Versions System]]
[[Category:Web Server (English)]]
+
{{merge|Concurrent Versions System}}
+
 
+
01) Open up a shell
+
 
+
 
+
02) su to root
+
 
+
 
+
03) Make sure you have the latest version of CVS
+
pacman -S cvs
+
 
+
 
+
04) Make sure you have the latest version of xinetd
+
pacman -S xinetd
+
 
+
 
+
05) Now create the directory that will become your CVS repository.
+
mkdir /home/cvsroot
+
 
+
 
+
06) Initialize your CVS repository
+
cvs -d /home/cvsroot init
+
 
+
 
+
07) Create a group called cvs - members of this group will have write access to the repository
+
groupadd cvs
+
 
+
 
+
08) Create a user named cvs
+
useradd -d /home -g cvs -p password cvs
+
 
+
 
+
09) Set the owner and group of the repository
+
chown -R cvs:cvs /home/cvsroot
+
 
+
 
+
10) Set the proper permissions for the repository(set group ID, owner: read write execute, group: read write execute, others: read execute)
+
chmod 2775 /home/cvsroot
+
 
+
 
+
Add any users that you want to have local access to the repository to the group cvs by using the following two steps.
+
 
+
 
+
11) Get a list of the groups for a user.
+
groups someuser
+
 
+
 
+
12) Set the groups for the user. The group1 group2 etc. are the groups you got from the previous step. '''NOTE: make sure not to use spaces when listing the additional groups'''
+
usermod -g users -G group1,group2,group3,cvs someuser
+
 
+
 
+
13) Make a file in /etc/xinetd.d/ called cvspserver with these contents:
+
 
+
service cvspserver
+
{
+
        port            = 2401
+
        socket_type    = stream
+
        protocol        = tcp
+
        wait            = no
+
        user            = root
+
        passenv        = /home/cvsroot
+
        server          = /usr/bin/cvs
+
        server_args    = -f --allow-root=/home/cvsroot pserver
+
}
+
 
+
14) Edit /etc/services and add cvspserver service if does not exist:
+
cvspserver 2401/tcp #CVS PServer
+
 
+
15) You must unset the variable HOME before you restart xinetd
+
unset HOME
+
 
+
 
+
16) Restart the xinetd server
+
/etc/rc.d/xinetd restart
+
 
+
 
+
17) Exit root
+
 
+
 
+
You can test out the server using the following commands:
+
 
+
export CVSROOT=:pserver:cvs@127.0.0.1:/home/cvsroot
+
cvs login
+
mkdir ~/sandbox
+
mkdir ~/sandbox/myproject
+
cd ~/sandbox/myproject
+
echo "this is a sample file" > myfile
+
cvs import -m "description of myproject" myproject v1 r1
+
cd ..
+
rm -R myproject
+
cvs checkout myproject
+
cd myproject
+
echo "some changes to the file" >> myfile
+
cvs commit -m "Explain changes here" myfile
+

Latest revision as of 08:46, 11 January 2012