Load CVS Source Code Content

Setting up CVS on CentOS 6 Linux pserver method Server/SELinux / Clients

NON-LDAP/EMPTY INITIAL CONTENTS

Creat CVS user and group
cvsadmin 

useradd cvsadmin
password cvsadmin


Install CVS system:
yum install cvs


Initialize the CVS directory
mkdir /cvs-root
chmod -R 775 /cvs-root
cd /cvs-root
mkdir pserver
cvs -d /cvs-root/pserver init

The file  /cvs-root/pserver/CVSROOT/config is already set up by this command.
Need a new  /cvs-root/pserver/CVSROOT/passwd file with passwd 12345

htpasswd -cb passwd estate 12345

outputs: 
estate:4ISPiYuaIBy8s



Then edit it so it looks like this:

estate@localhost:4ISPiYuaIBy8s:cvsadmin


Edit the xinet.d cvs settings  as below and save as
/etc/xinetd.d/cvspserver

[root@cvs xinetd.d]# more cvspserver
# default: off
# description: The CVS service can record the history of your source \
#              files. CVS stores all the versions of a file in a single \
#              file in a clever way that only stores the differences \
#              between versions.
service cvspserver
{
    port            = 2401
    socket_type        = stream
    protocol        = tcp
    wait            = no
    user            = root
    passenv            = PATH
    server            = /usr/bin/cvs
    env            = HOME=/cvs-root/pserver
    server_args        = -f --allow-root=/cvs-root/pserver pserver
}


Restart xinetd:
sudo kill -HUP `cat /var/run/xinetd.pid`

 
Poke hole in firewall Default port 2401 !
iptables -I
INPUT -p tcp --dport 2401 -j ACCEPT
iptables -I OUTPUT -p tcp --sport 2401 -j ACCEPT
service iptables save


Fix SELINUX settings

cd /
chcon -R -t cvs_data_t /cvs-root

LOOKS LIKE THIS:

# ls -alZ
drwxrwxr-x. cvsadmin cvsadmin unconfined_u:object_r:cvs_data_t:s0 .
drwxrwxr-x. root     root     unconfined_u:object_r:cvs_data_t:s0 ..
drwxrwxr-x. cvsadmin cvsadmin unconfined_u:object_r:cvs_data_t:s0 CVSROOT



EXAMPLE -
PUTTING BRAND NEW SOURCE CODE INTO CVS
IMPORTING NCBI X Toolkit into CVS


Install NCBI toolkit as root into an appropriate directory

cd /root/temp/ncbi

ftp ftp.ncbi.nlm.nih.gov/toolbox/ncbi_tools/ncbi.tar.gz

 

Then uncompress and untar the file with:

gunzip ncbi.tar.gz

tar –xvf ncbi.tar.gz



Check for and apply patch(es)!! if necessry

IMPORTANT!
remove .cvsignore files from

./asn/.cvsignore
./data/.cvsignore
./.cvsignore


Make dummy.txt files in
./ncbi/build
./ncbi/include
./ncbi/lib

DO THE IMPORT (gets an exact copy! from ncbi and puts it into the repository directory $/CVSROOT/ncbitk))
 cvs import -I ! -m "Import of NCBI toolkit vAug26_2007" ncbitk ncbi initial


How do i generate a passwd file in $CVSROOT/CVSROOT?

Please see the CVS documentation for information on the format of the $CVSROOT/CVSROOT/passwd file.

htpasswd command should be used to generated passwd file in the $CVSROOT/CVSROOT directory.

htpasswd is the default built in command in linux. To create passwd file and storing userrname and encrypted passwd in the file. htpasswd -c passwd userA return prompts for password for userA and Re-Type confirmation. To add more username's in the passwd file use the following command.

SYNTAX : htpasswd -b <PASSWD FILE> <USERNAME> <PASSWORD>
EXAMPLE: htpasswd -b passwd userB userB
Edit accordingly.

 
CVS USER SETUP

CONFIGURE CVS user - need 3 user files:
.bash_profile
.cvsrc
.cvspass

[chogue@localhost ~]$ more .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
export CVSROOT=:pserver:chogue@localhost:/usr/local/cvsroot

source .bash_profile
[chogue@localhost ~]$ echo $CVSROOT
:pserver:chogue@localhost:/usr/local/cvsroot


[chogue@localhost~]$ more .cvspass
/1 :pserver:chogue@localhost:2401/usr/local/cvsroot AEw'e%)=

[chogue@localhost~]$ more .cvsrc
log -N
diff -uN
rdiff -u
update -Pd
checkout -P
release -d

Access CVS Remotely:


A local port forwarding command would allow cvs server to be accessed remotely, the following command would map the port 2401 of the cvs machine to the port 2401 of the remote host:

ssh -L 2401:10.0.10.10:2401 sshuser@137.132.20.100

After the connection established, set up cvs as if the cvs server on local host, the following is a example .bash_profile file:

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
export CVSROOT=:pserver:mingxi@localhost:/cvs-root/pserver

Comments