Skip to main content

How to configure CVS


Steps:

1. install cvs and xinetd on the server

$yum install cvs
$yum install xinetd

NOTE: check whether cvs (or xinetd) has been installed:
$rpm -qa | grep cvs

create your CVS home repository:
mkdir /var/local/cvshome

add it as CVSROOT and export to profile
vim /etc/profile


##add line 
export CVSROOT=/var/local/cvshome


2. set up cvs group and user on the server:

$groupadd cvsusers
$useradd -g cvsusers -G cvsusers -d /var/local/cvshome cvsadmin
$passwd cvsadmin   # set up password for cvsadmin

Add harun to the cvs group:
$usermod -G harun cvsusers

Check whether harun is in the cvs group:
$groups harun


3. change owner of /home/cvsroot if necessary, chmod for /home/cvsroot:

$chown -R cvsadmin:cvsusers /var/local/cvshome
$chmod -R 775  /var/local/cvshome


4. initialize cvs:

(login as cvsroot)
$cd  /var/local/cvshome
$cvs -d  /var/local/cvshome init  # full path is required
$chmod 644  /var/local/cvshome/CVSROOT/config


5. create file for CVS self-startup, as xinetd type

(login as root)
$cd /etc/xinetd.d
$cp cvs cvspserver
$vim cvspserver  # do the following modifications:

# 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
{
disable                 = no             # modify
port                       = 2401
socket_type       = stream
protocol               = tcp
wait                       = no
user                       = root
passenv               = PATH
server                   = /usr/bin/cvs
env                         = HOME= /var/local/cvshome    # modify
server_args        = -f –allow-root= /var/local/cvshome pserver    # modify
}

If you want to create multiple repository, add an additional --allow-root=[repository path] argument for each repository.

6. add CVS as a service:

$vim /etc/services

Add two lines if not in the file:
cvspserver 2401/tcp #pserver cvs service
cvspserver 2401/udp #pserver cvs service


7. restart xinetd:

$/etc/init.d/xinetd restart


8. check if cvspserver has started

$netstat -anlp |grep cvspserver

should return:
tcp   0    0            *:cvspserver           *:*               LISTEN


9. manage users (Optional)

$cp /etc/shadow /home/cvsroot/CVSROOT/passwd   # owner of passwd should be cvsroot:cvs
($cd /home/cvsroot/CVSROOT)
$chmod 644 passwd

modify passwd, delete all lines except users cvsroot and mike (you can keep some lines if needed)
for every line, delete all the content after the second “:”, and append cvsroot to that “:”


10. on client c.com, log in to the CVS server:

$export CVSROOT=:pserver:harun@s.com:2401/var/local/cvshome
$cvs login


11. on client c.com, import a project /home/mike/myproject onto CVS server:

$cd /home/harun/myproject
$cvs import -m “my project” myproject harun start


12. errors:

1) As follows:
[mike@c.com ~]$ cvs -d :pserver:mike@s.com:/home/cvsroot login
Logging in to :pserver:mike@s.com:2401/home/cvsroot
CVS password:
cvs [login aborted]: unrecognized auth response from localhost: cvs pserver: cannot open /home/cvsroot/CVSROOT/config: Permission denied

Solution: turn off SELinux on s.com.
Turn it off now:
$setenforce 0

Turn it off after next restart:
$vim /etc/selinux/config
modify SELINUX=enforcing to
SELINUX=disabled

//Or can be another solution
  1. At this point, CVS has been configured but SELinux will still deny logins and file access. To demonstrate this, set the $CVSROOT variable on cvs-client and try to log in remotely. The following step should be performed on cvs-client:
    [cvsuser@cvs-client]$ export CVSROOT=:pserver:cvsuser@192.168.1.1:/cvs
    [cvsuser@cvs-client]$
    [cvsuser@cvs-client]$ cvs login
    Logging in to :pserver:cvsuser@192.168.1.1:2401/cvs
    CVS password: ********
    cvs [login aborted]: unrecognized auth response from 192.168.100.1: cvs pserver: cannot open /cvs/CVSROOT/config: Permission denied
    
    SELinux has blocked access. In order to get SELinux to allow this access, the following step should be performed on cvs-srv:
  2. Change the context of the /cvs/ directory as the root user in order to recursively label any existing and new data in the /cvs/ directory, giving it the cvs_data_t type:
    [root@cvs-srv]# semanage fcontext -a -t cvs_data_t '/cvs(/.*)?'
    [root@cvs-srv]# restorecon -R -v /cvs

2) As follows:
[mike@c.com ~]$ cvs login
Logging in to :pserver:mike@s.com:2401/home/cvsroot
CVS password:
cvs [login aborted]: connect to [s.com]:2401 failed: No route to host

Solution: turn off firewall on s.com, or allow 2401 port in the firewall
Turn off firewall now:
service iptables stop

Turn off firewall after next restart:
$chkconfig iptables off   # or $/sbin/chkconfig –level 2345 iptables off

Check firewall status:
$/etc/init.d/iptables status

Comments

Popular posts from this blog

তৈদুছড়া ঝর্ণা : খাগড়াছড়ি

(সংগৃহীত) তৈদুছড়া ঝর্ণা:তৈদুছড়া এলাকায় খুব কাছাকাছিই বড় ঝর্ণা আছে তিনটি।এছাড়া এক ঝর্ণা থেকে আরেক ঝর্ণায় যাওয়ার পথে আছে বেশ কয়েকটি ছোট ঝর্ণা এবং যাওয়ার ঝিরিপথটাও অসাধারণ সুন্দর। ঝর্ণা দেখার সাথে সাথে পাহাড়ের ঢাল বেড়ে ট্রেকিং- এর থ্রিলটাও পাওয়া যাবে এখানে। পুরো এলাকাতেই জুম চাষ করা হয়,তাই পাহাড়ের ঢালে ঢালে দেখা পাবেন অসংখ্য সুন্দর সুন্দর জুম ঘরের। যেভাবে যাবেন: ঢাকা থেকে শান্তি পরিবহনে সরাসরি আসতে পারেন দিঘীনালায়,অথবা শ্যামলী, এস আলম সেন্টমার্টিন পরিবহনে খাগড়াছড়ি এসে খাগড়াছড়ি থেকে সিএনজ ি তে আসতে পারবেন দিঘীনালা।খাগড়াছড়ি -দিঘীনালা সময় লাগবে ৪০ মিনিট। ভাড়া ৬০টাকা। দিঘীনালার জামতলি থেকে হেঁটে যেতে হবে ঝর্ণায়,দিঘীনালা থেকে জামতলি যেতে পারবেন অটোরিকশায়।ঝর্ণায় যেতে ২-৩ ঘন্টা লাগে,সকালে রওনা দিলে বিকেলের মধ্যেই ফিরে আসা যায়। থাকবেন কোথায়:দিঘীনালায় ফ্যামিলি নিয়ে থাকার মত হোটেল রয়েছে বাস স্টেশনের পাশেই। বাস স্টেশন থেকে তিন মিনিট হাঁটলে বোয়ালখালি বাজারেও পাবেন থাকার হোটেল। সাথে যা যা নিতে হবে:শুকনো খাবার নিয়ে নিতে হবে সাথে,পানিও নিয়ে নেবেন।দড়ি নেবেন,কাজে লাগবে।অবশ্যাই ভালো গ্রিপ আ...

How to automatically rotate catalina.out daily

How to automatically rotate catalina.out daily or when it becomes bigger than 5M 1. Create this file /etc/logrotate.d/tomcat   2. Copy the following contents into the above file /usr/tomcat/default/logs/catalina.out {    copytruncate    daily    rotate 7    compress    missingok     size  5M   }   About the above configuration: Make sure that the path  /var/log/tomcat/catalina.out  above is adjusted to point to your tomcat’s catalina.out daily  -  rotates the catalina.out  daily rotate  – keeps at most  7  log files compress –  compresses   the rotated files size  – rotates if the size of catalina.out is bigger than  5M copytruncate  – truncates the original log file in place after creating a copy, instead of moving the old log file and optionally creatin...

How to batch INSERT and UPDATE statements with Hibernate

Courtesy: VLAD MIHALCEA Introduction JDBC  has long been offering support for  DML  statement batching. By default, all statements are sent one after the other, each one in a separate network round-trip. Batching allows us to send multiple statements in one-shot, saving unnecessary socket stream flushing. Hibernate hides the database statements behind a transactional  write-behind abstraction layer . An intermediate layer allows us to hide the JDBC batching semantics from the persistence layer logic. This way, we can change the JDBC batching strategy without altering the data access code. Configuring Hibernate to support JDBC batching is not as easy as it should be, so I’m going to explain everything you need to do in order to make it work. Testing time We’ll start with the following entity model: The  Post  has a one-to-many association with the  Comment  entity: 1 2 3 4 5 @OneToMany (    ...