为编程开发准备一台友好的CVS服务器
真正做起来开发工作,才发现一台CVS服务器是必不可少的,即使是很少的开发人员的项目,使用CVS也会起到很大的作用,具体什么作用,大家去体会:)
下面就把我架设CVS服务器的过程说说,和诸位前辈的不同之处在于我架设了一个WEB界面,
所以说是"友好的",通过WEB界面可以非常直观的浏览代码,查看图形化的修改记录,(提交
可以log到MySQL数据库--This feature is a clone of the Mozilla Projects
Bonsai database.),目前SourceForge正在使用此界面的较低版本.
功能简介:
1:Base CVS Server;
2:repository browsing.
3:SQL checkin database.
4:Colorize sourcecode.
5:Can display a clickable, graphical of files in a CVS repository.
6:generate tarball from a repository on the fly.
OK,Lets go!
1:初始化环境
#groupadd cvs
#mkdir /home2/cvsroot
#useradd -g cvs -G cvs -d /home2/cvsroot cvsroot
#su - cvsroot
$chmod 775 .
OK!
2:启动CVS Server
诸位大虾已经有了很精辟的说明,拿来就是了!:P
#more /etc/services|grep cvspserver
cvspserver 2401/tcp # CVS client/server operations
cvspserver 2401/udp # CVS client/server operations
OK,RedHat系统不傻,可以写脚本了.
#vi /etc/xinetd.d/cvspserver
service cvspserver
{
disable = no
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/bin/cvs
server_args = -f --allow-root=/home2/cvsroot pserver
log_on_failure += USERID
}
:wq
#ls /etc/xinetd.d/cvspserver
/etc/xinetd.d/cvspserver
脚本好了!
#su - cvsroot
$cvs -d /home2/cvsroot init
#service xinetd restart
看看有没有?
#netstat -l |grep cvspserver
tcp 0 0 *:cvspserver *:* LISTEN
Great!
3:Add a Web Interface,viewcvs-0.9.2
URL:http://viewcvs.sourceforge.net/
要求比较个性,很多很多!列表:
a:
Python 1.5 or later(http://www.python.org/)
Rh7.2竟然有两个python,1.5和2.1,更加有个性!
b:
RCS, Revision Control System(http://www.cs.purdue.edu/homes/trinkle/RCS/)
Rh7.2自带.
c:
read-only, physical access to a CVS repository(See http://www.cvshome.org/ for more information)
Rh7.2自带.
d:
a web server capable of running CGI programs(for example, Apache at http://httpd.apache.org/)
viewcvs-0.9.2文档竟然说apache是可选项:(
e:
GNU-diff to replace broken diff implementations(http://www.gnu.org/software/diffutils/diffutils.html)
Rh7.2自带.
f:MySQL to create and query a commit database(http://www.mysql.com/)
Rh7.2自带.
g:(http://sourceforge.net/projects/mysql-python)(and Python 1.5.2 or later)
去拉
h:Enscript to colorize code displayed from the CVS repository(http://people.ssh.com/mtr/genscript/)
去拉
i:CvsGraph for a graphical representation of the CVS revisions(http://www.akhphd.au.dk/~bertho/cvsgraph/)
去拉
#tar zxvf cvsgraph-1.1.3.tar.gz
#cd cvsgraph-1.1.3
#./configure
#make
#cp cvsgraph /usr/bin
#mkdir /etc/cvsgraph
#cp cvsgraph.conf /etc/cvsgraph
#rpm -ivh egenix-mx-base-2.0.3-py2.1_1.i386.rpm
#rpm -ivh MySQL-python-0.9.1-1py2.i386.rpm
#tar zxvf viewcvs-0.9.2.tar.gz
#cd viewcvs-0.9.2
#./viewcvs-install
#cp /usr/local/viewcvs-0.9.2/cgi/viewcvs.cgi /var/www/cgi-bin
#cp /usr/local/cvsview-0.9.2/PyFontify* /usr/lib/python2.1/
#cp /usr/local/cvsview-0.9.2/py2html* /usr/lib/python2.1/
OK!
/**********MySQL****************/
建两个用户,cvsroot(password:cvsroot)使用root权限,cvsread(password:cvsread)
使用只读权限.
#/usr/local/cvsview-0.9.2/make-datebase
OK!
#vi /usr/local/viewcvs-0.9.2/viewcvs.conf
cvs_roots =
Development : /home2/cvsroot
rcs_path = /usr/bin/
address = [email protected]
host = localhost
database_name = ViewCVS
user = cvsroot
passwd = cvsroot
readonly_user = cvsread
readonly_passwd = cvsread
row_limit = 1000
py2html_path = /usr/lib/python2.1
enscript_path = /usr/bin/
allow_tar = 1
use_cvsgraph = 1
********************************************************
***如果同时安装python-1.x和python-2x(比如RedHat7.2)
***以下千万注意(我们使用python-2.x)
********************************************************
cd /usr/local/viewcvs-0.9.2
loginfo-handler,standalone.py,cvsdbadmin
以及
cd /usr/local/viewcvs-0.9.2/cgi下的所有文件,
首行改为:#!/usr/bin/python2
#cp /usr/local/viewcvs-0.9.2/cgi/viewcvs.cgi /var/www/cgi-bin
http://127.0.0.1/cgi-bin/viewcvs.cgi/
OK了!
4:Add user
#usermod -G cvs uname #使用系统验证
OK,enjoy CVS!
5:微调
#mkdir /var/lock/cvs
#mkdir /var/lock/cvs/CVSROOT
#chmod -R 775 /var/lock/cvs
#chown -R cvsroot.cvs /var/lock/cvs
#su - hleil
$export CVSROOT=:pserver:[email protected]:/home2/cvsroot
$cvs login
$cvs checkout CVSROOT
$cd CVSROOT
$vi loginfo
ALL (echo %{sVv}; cat) | /usr/local/viewcvs-0.9.2/loginfo-handler #SQL checkin
:wq
$vi config
SystemAuth=yes #使用系统验证
LockDir=/var/lock/cvs #for security
LogHistory=all
:wq
$cvs commit
#service xinetd restart
Great!终于好了!
呵呵,下面就开始你的代码之旅吧!
来源:LinuxAID论坛
页:
[1]