Wednesday, March 08, 2006

Bagaimana menginstall CVS server di Centos 4.2??

ahHal yang pertama harus dilakukan adalah menginstall CVS server di komputer kita, check dengan perintah dibawah ini:

#rpm -qa grep cvs (jika sudah terinstall makan akan muncul seperti dibawah ini)
cvs-1.11.17-2
Atau apabila tampilannya kosong berarti belum terinstall.

Apabila CVS belum terinstall maka dapat diinstall dengan cara:

#rpm -ivh cvs-1.11.17-2.rpm

atau bisa juga langsung menggunakan perintah yum supaya langsung mengambil dari repository di internet.

#yum install cvs

Setelah cvs terinstall dengan sempurna buat file /etc/xinetd.d/cvspserver dan masukkan script berikut ke file berikut:

# 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 =
server_args = --allow-root=/home/cvsroot -f pserver
env = HOME=/home/cvsroot
log = /var/log/cvslog (Buat direktori /var/log/cvslog)
}

Lalu ikuti perintah berikut ini sebagai root tentunya:

#export CVSROOT=/home/cvsroot
#/usr/sbin/useradd -M cvsuser (membuat user tanpa membuat home direktori)
#groupadd cvsadmin
#mkdir $CVSROOT
#chmod -R 775 $CVSROOT
#chgrp -R cvsadmin $CVSROOT
#touch $CVSROOT/locks
#cvs init (membuat $CVSROOT/CVSROOT)
#cd /root
#cvs checkout CVSROOT

lalu edit /root/CVSROOT/config dan masukkan

# 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



#cd
#cvs commit CVSROOT/config

Untuk memasukkan user fajar:
#htpasswd -d -c /home/cvsroot/passwd fajar

lalu kopikan file /home/cvsroot/passwd ke /home/cvsroot/CVSROOT/passwd

#cp /home/cvsroot/passwd /home/cvsroot/CVSROOT/passwd

Lalu edit file /etc/cvsroot/CVSROOT/passwd dengan bentuk seperti ini

[username]:[password terenkripsi]:[user CVS]

contoh untuk konfigurasi diatas:

fajar:1etfgfy90dft:cvsuser

Lalu edit file /home/cvsroot/cvswrappers seperti dibawah ini:

# 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'


Lalu restart

#/etc/init.d/xinetd restart

lalu gunakan perintah netstat -tapn dan apakah port 2401 sudah listen???apabila sudah berarti cvs server sudah jalan dan kita tinggal mengetesnya.

gunakan perintah seperti dibawah ini:

$export CVSROOT=:pserver:fajar@yourhostname:/home/cvsroot

$cvs login

jika tidak ada gagal berarti sudah berhasil.
Untuk mencoba cvs server kita dari windows client dapat menggunakan TortoiseCVS.

No comments: