Linux配置CVS

Table of Contents
  • CVS Install
  • Install CVS Server
  • Config CVS Server
  • Sercuitry Config
  • Verify CVS Server
  • Firewall changes
  • Reference

CVS Install

1、验证是否已安装CVS
#rpm -q cvs
如果能显示出类似这样的版本信息,证明已安装CVS:
#cvs-1.11.2-10

 

 

The CVS must compile and install with root user
  • copy cvs source code to /usr/local/src

Install CVS Server

 

cp cvs-1.12.13.tar.gz /usr/local/src
cd /usr/local/src
gzip -d cvs-1.12.13.tar.gz
tar -xvf cvs-1.12.13.tar
cd cvs-1.12.13
  • make and install,You can use –prefix to set your cvs server installed folder
./configure --prefix=/usr/local/cvs
make
make install

 

Config CVS Server
  • Add CVS port on /etc/services file
cvspserver      2401/tcp                        # CVS client/server operations
cvspserver      2401/udp                        # CVS client/server operations
  • Create (as root) the file /etc/xinetd.d/cvspserver, like below:
# default: off
# description: cvspserver
service cvspserver
	{
#         id        = cvspserver
          socket_type    = stream
          protocol    = tcp
          user        = root
          wait        = no
          disable        = no
          server          = /usr/bin/cvs
        Port         = 2401
#       passenv     = PATH
        server_args     = --allow-root=/home/cvsroot -f pserver
#        env = HOME=/home/cvsroot
        log = /var/log/cvslog
	}                                                                              

 

扫描二维码关注公众号,回复: 1181022 查看本文章

Sercuitry Config

  • Create cvs system user and group, Issue following commands as root:
	export CVSROOT=/home/cvsroot
	# create group cvsadmin
	groupadd cvsadmin
	# create a nologin user cvsuser without creating home dir
	useradd -g cvsadmin -s /sbin/nologin  -M cvsuser
	mkdir $CVSROOT
	touch $CVSROOT/locks
	# creates $CVSROOT/CVSROOT
	cvs init
	chmod -R 775 $CVSROOT
	chgrp -R cvsadmin $CVSROOT
  • Change privileges, edit /home/cvsroot/CVSROOT/config like this:
      # Set this to "no" if pserver shouldn't check system users/passwords
      SystemAuth=no
      # Set `TopLevelAdmin' to `yes' to create a CVS directory at the top
      # level of the new working directory when using the `cvs checkout'
      # command.
      TopLevelAdmin=yes
  • To add cvs virtual user cvs_test, mike:
htpasswd -d -c /home/cvsroot/CVSROOT/passwd cvs_test
  • To add additional users:
htpasswd -d /home/cvsroot/CVSROOT/passwd mike
  • Add a colon and 'cvsuser' after each encrypted password in /home/cvsroot/CVSROOT/passwd file:
	cvs_test:WEOI$(@(@(#JD(:cvsuser
	mike:WEfe$(@#$@(#DE(:cvsuser
  • Edit /home/cvsroot/CVSROOT/cvswrappers:
# This file affects handling of files based on their names.
#
# The -t/-f options allow one to treat directories of files
# as a single file, or to transform a file in other ways on
# its way in and out of CVS.
#
# The -m option specifies whether CVS attempts to merge files.
#
# The -k option specifies keyword expansion (e.g. -kb for binary).
#
# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers)
#
# wildcard [option value][option value]...
#
# where option is one of
# -f from cvs filter value: path to filter
# -t to cvs filter value: path to filter
# -m update methodology value: MERGE or COPY
# -k expansion mode value: b, o, kkv, &c
#
# and value is a single-quote delimited value.
# For example:
#*.gif -k 'b'
*.gif -k 'b'
*.tga -k 'b'
*.bmp -k 'b'
*.psd -k 'b'
*.tif -k 'b'
*.png -k 'b'
*.iff -k 'b'
*.aiff -k 'b'
*.obj -k 'b'
*.dat -k 'b'
*.exe -k 'b'
*.com -k 'b'
*.dll -k 'b'
*.dsw -k 'b'
*.dsp -k 'b'
*.lwo -k 'b'
*.lws -k 'b'
*.p -k 'b'
*.ico -k 'b'
*.frx -k 'b'
*.class -k 'b'
*.jar -k 'b'
*.zip -k 'b'
*.lzh -k 'b'
*.lha -k 'b'
*.rar -k 'b'
*.arj -k 'b'
*.arc -k 'b'
*.avi -k 'b'
*.mov -k 'b'
*.asf -k 'b'
*.smk -k 'b'
*.jpg -k 'b'
*.mpg -k 'b'
*.swf -k 'b'
*.frx -k 'b'
*.fli -k 'b'
*.flc -k 'b'
*.tiff -k 'b'
*.bin -k 'b'
*.dat -k 'b'
*.wad -k 'b'
*.ppt -k 'b'
*.pdf -k 'b'
*.3ds -k 'b'
*.max -k 'b'
  • Set access privileges for files
chmod -R 775 $CVSROOT
chgrp -R cvsadmin $CVSROOT
  • Restart xinetd:
/etc/init.d/xinetd restart

 

Verify CVS Server

  • Try if it works:
export CVSROOT=:pserver:[email protected]:/home/cvsroot
cvs login

Firewall changes

  • To open firewall to access this server from (for example) host 192.168.0.88 , add a line to /etc/sysconfig/iptables:
      
-A RH-Firewall-1-INPUT -s 192.168.0.88 -p tcp --dport 2401 -j ACCEPT
and restart iptables:
/etc/init.d/iptables restart
  • Connect to cvs with WinCVS Cline as below URL:
:pserver;username=dev;password=123456;hostname=192.168.0.88;port=2401:/home/cvsroot

 

Reference

  • Read cvs docs:
info -f cvs

猜你喜欢

转载自mybeautiful.iteye.com/blog/750892
cvs