==Setting up a CVS server==
By Nathan Butcher 2006.12.6

When you have multiple servers rolled out running FreeBSD, or you manage a large
 network where it is very likely that students/researchers are going to maintain 
their own FreeBSD servers, it's a good idea to create a CVS server for this 
purpose. Also for security reasons, you don't want each of your servers going out
 to the internet unneccessarily.

A CVS server syncs itself with the latest patches in the FreeBSD source code. 
Also, a CVS server is capable of synchronizing itself with the latest updates in
 the BSD ports database (for sotware updates).

This install follows on from my basic FreeBSD install, so that will need to be 
done first before proceeding. There is just one thing you will need to be careful
 of when installing, and this is to create a rather large /home partition. This
 is where your synchronized CVS code will reside for downloading by your clients.

A safe figure for /home is about 20GB (and I doubt you'll even use a third of 
that)


8. Installing CVSup

Make sure you select a mirror for CVS updates. Preferably choose one in your own country.

8.1  cvsup-mirror install

Installing a cvsup-mirror server is actually very simple. Just answer all the 
questions asked. Aside from the defaults, I've listed what I'd normally do next
 to the questions.

# cd /usr/ports/net/cvsup-mirror
# make
===>  Vulnerability check disabled
===>  Extracting for cvsup-mirror-1.3_2
===>  Patching for cvsup-mirror-1.3_2
===>  Configuring for cvsup-mirror-1.3_2
I am going to ask you a few questions so that I can set up your
FreeBSD mirror configuration.  Every question has a [default]
answer.  To accept the default, just press ENTER.

At this point, I am just gathering information.  I will not touch
your system until you type "make install".

Master site for your updates [cvsup-master.freebsd.org]? cvsup3.jp.freebsd.org

How many hours between updates of your files [1]? 3

Now you must decide which sets of files you wish to make available
from your mirror site.  You can choose any combination, and you
can put each set anywhere you want to on your disks.  Although each
set is optional, we strongly encourage every mirror site to carry
at least the main source repository.

Do you wish to mirror the main source repository [y]?

Where would you like to put it [/home/ncvs]?

Do you wish to mirror the installed World Wide Web data [y]? n

Do you wish to mirror the GNATS bug tracking database [y]? n

Do you wish to mirror the mailing list archive [y]? n

Now, a few questions so that I can set up your CVSup server properly.


For security reasons, both the CVSup client and server should run
under their own unique user and group IDs.  These IDs should have no
special access privileges.  Normally, the user:group "cvsupin:cvsupin"
is used for the client and "cvsup:cvsup" is used for the server, but
you can choose other names if you wish.  At "make install" time, I
will create the users and groups, if they don't already exist.

Use unique user and group IDs for these.  Do not use "nobody",
"nonroot", or "nogroup".

Unique unprivileged user ID for running the client [cvsupin]?
Unique unprivileged group ID for running the client [cvsupin]?
Unique unprivileged user ID for running the server [cvsup]?
Unique unprivileged group ID for running the server [cvsup]?

The CVSup server does its logging via syslog.  At "make install"
time, I will set up the logging for you, if necessary.  I will use
the "!program" feature of syslog to keep your CVSup log messages
separate from the messages of your other daemons.

Syslog facility for the server log [daemon]?

You can control the load on your machine by limiting the number of
clients that the CVSup server will serve at once.  CVSup won't load
your network especially heavily, but it is more CPU and disk
intensive than most other file server software.

Maximum simultaneous client connections [8]? 16

Building the "config.sh" file ... Done.
Building the "cvsupd.access" file ... Done.


8.2 Check the default configuration

# cat /usr/local/etc/cvsup/config.sh
user="cvsup"
group="cvsup"
cuser="cvsupin"
cgroup="cvsupin"
host="cvsup3.jp.freebsd.org"
interval="3"
maxclients="16"
facility="daemon"
distribs="distrib.self .. . FreeBSD.cvs /home/ncvs . FreeBSD-www.current SKIP . 
FreeBSD-gnats.current SKIP gnats FreeBSD-mail.current SKIP ."


8.3 make install
# make install

You need a group "cvsup".
Would you like me to create it [y]?
Done.
You need a user "cvsup".
Would you like me to create it [y]?
Done.
You need a group "cvsupin".
Would you like me to create it [y]?
Done.
You need a user "cvsupin".
Would you like me to create it [y]?
Done.
Would you like me to create cvsupin's home directory (/home/cvsupin) [y]?
Fixing ownerships and modes in "/usr/local/etc/cvsup".
Setting up links and directories for distributions.
  Linking distrib.self -> ..
  Linking FreeBSD.cvs -> /home/ncvs
  Fixing ownerships and modes in /home/ncvs ... done.
  Linking FreeBSD-www.current -> SKIP
  Linking FreeBSD-gnats.current -> SKIP
  Linking FreeBSD-mail.current -> SKIP

Would you like me to set up the syslog logging [y]?
Setting up server logging in "/etc/syslog.conf".
Creating "/var/log/cvsupd.log".
Giving syslogd a kick in the pants.
Adding cvsupd log entry to "/etc/newsyslog.conf".
Done.

Would you like me to set up your crontab for updates every 3 hours [y]?
Scheduling updates every 3 hours in "/etc/crontab".
Done.  The first update will be 5 minutes from now, at 17:58.
The cvsupd server will be started automatically after the first update,
and whenever you reboot.

You are now a FreeBSD mirror site.
===>   Registering installation for cvsup-mirror-1.3_2

Once that's out the way, you're just about ready to go.


8.4. check the supfile parameters.

# vi supfile
#
# Standard supfile for CVSup FreeBSD mirrors.
#
*default delete use-rel-suffix umask=002
cvs-all      release=cvs     prefix=prefixes/FreeBSD.cvs
gnats        release=current prefix=prefixes/FreeBSD-gnats.current
www          release=current prefix=prefixes/FreeBSD-www.current
mail-archive release=current prefix=prefixes/FreeBSD-mail.current
distrib      release=self    prefix=prefixes/distrib.self


8.5. Operation test
We want to be sure that data is written to /usr/home/ncvs

# sh /usr/local/etc/cvsup/update.sh
# ls -R /home/ncvs
/usr/local/etc/cvsup/stable-supfile

And now we're done.
Hosted by www.Geocities.ws

1