Concurrent Versioning System (CVS) aids team members share codes and files very effectively, and tracks the changes made to any file. Its development has not been very active for the past few years, but many still see the benefits of such a sharing system.
There are several free central repository or file sharing systems these days, like GitHub (but your codes will be on public display in GitHub unless you pay for it) and Google Drive. But for privacy reasons, I think many developers prefer to share codes on their own server and synchronise within their control.
Apache Subversion (SVN) also performs very similarly to CVS, and seems to be in active development, so maybe I’ll write about it some time.
Cut to the chase, here is how to install CVS on your CentOS server:
- Install CVS using yum:
yum install cvs
xinetdisn’t installed, install it too:
yum install xinetd
- It is good practice to create a group for users that are going to access CVS on your server:
- Add a user to your new group,
- New user:
useradd -G cvs luvelle.
Then add a password:
- Existing user:
usermod -a -G cvs luvelle
- New user:
- Your user should now be in the
- Decide where you’d like to store your files that will be synchronised by CVS, and create the directory, e.g. in
- Initialise that directory using CVS:
cvs -d /home/cvsroot init
- Restrict access to your configuration file in CVSROOT:
chmod 644 /home/cvsroot/CVSROOT/config
- Create a file in
/etc/xinetd.dif it doesn’t exist for your CVS service:
Type in the following:
disable = no
socket_type = stream
wait = no
user = root
group = cvs
log_type = FILE /var/log/cvspserver
protocol = tcp
env = '$HOME=/home/cvsroot' # change if your directory is different
bind = 192.168.0.1 # change this to your server IP address
log_on_failure += USERID
port = 2401 # make sure your port is open
server = /usr/bin/cvs
server_args = -f --allow-root=/home/cvsroot pserver
- Make sure CVS is a service in
Add the following lines if they are not inside:
service xinetd restart
- Check if
ss -l | grep cvspserver
You should see this:
tcp LISTEN 0 0 <your-ip-address>:cvspserver *:*
- If you’d like to let your users use the same password to log into CVS, copy the password file:
cp /etc/shadow /home/cvsroot/CVSROOT/passwd
Then change its access rights:
chmod 644 /home/cvsroot/CVSROOT/passwd
Modify the file by deleting all lines except those you expect to access CVS on your server.
For the remaining lines, delete everything after the second “:”, and add “cvsroot”, so that it looks like this:
Now you’re almost good to go!
On your client end, you may download a client with a UI (SmartCVS is a good choice), or install CVS on your machine and use command line in your machine.
Suppose you picked the latter, after installing CVS, you may add the following export statement into your .bash_profile file, or simply enter into your terminal:
The former method makes it “permanent”, as you do not have to re-enter it after you close your terminal, so some of you may prefer saving it into your profile if you are going to be active on CVS.
Try logging in:
Or importing something:
cvs import -m "I am testing CVS" your-checkout-folder your-project-name start
A quick search on Google will give you all the necessary commands you need to carry out the tasks you need to do on CVS.