linux 下cvs 服務的配置

來源:互聯網
上載者:User
CVS 代表協作版本系統;這是一個將一組檔案放在層次分類樹中以保持同步的系統。人們可以從 CVS 伺服器上更新他們的本地層次樹副本,並將修改的結果或新檔案發回;或者刪除舊檔案。 CVS 基於用戶端/伺服器的行為使得其可容納多使用者,構成網路也很方便。

下面是我自己在配置CVS伺服器和用戶端的一點步驟總結,希望能幫你節省時間,一步到位^-^

設定管理員的全部步驟如下:

首先確認一下是否安裝cvs服務:

#rpm  -qa|grep cvs

如出現cvs版本號碼說明安裝成功.

否則到http://www.cvshome.org去下載rpm包.

安裝    --已經裝好的跳到下一步
rpm –ivh cvsnt-2.0.58d-1.i386.rpm(rpm包名)

1:我用的是Mandrivia linux 2006 free,安裝系統的時候選擇上了CVS的安裝包

2:建立了cvs使用者組

#groupadd cvs(如出現沒有groupadd命令,請用root帳號)

3:與etc 同級目錄下(其實就是掛載點/下)建立一個cvs目錄

# mkdir  cvs

3.建立cvs組的cvsroot使用者和所屬的目錄

#useradd -g cvs -G cvs -d/cvs cvsroot

4:為cvsroot使用者添加密碼

#passwd cvsroot

5:改變/cvs的目錄屬性

#chmod 775 /cvs

6:初始化cvs源碼庫,此操作組建目錄/cvs/CVSROOT,其下為一些初始設定檔案

#cvs -d/cvs init

7:建立可以登陸cvs服務的使用者及密碼,需要建立檔案passwd

#vi /cvs/CVSROOT/passwd
檔案內容如下:

username:xxxxx:cvsroot

8.xxxxxx為密碼,
獲得方法:編輯passwd.pl檔案:#> vi /cvsroot/passwd.pl,內容如下:

#!/usr/bin/perl
srand (time());
my $randletter = "(int (rand (26)) + (int (rand (1) + .5) % 2 ? 65 : 97))";
my $salt = sprintf ("%c%c", eval $randletter, eval $randletter);
my $plaintext = shift;
my $crypttext = crypt ($plaintext, $salt);
print "${crypttext}/t/n";

#>chmod a+x passwd.pl


9. 如果你想產生一個密碼是“123456”,則:

#> ./passwd.pl “123456”
斷行符號即可得到加密密碼,用其替換passwd檔案中的xxxxxx

10.加入cvs服務(我的Mandrivia 2006預設就有cvs服務,所以不用加)
#vi /etc/services
cvspserver 2401/tcp #pserver cvs service
cvspserver 2401/udp #pserver cvs service

11.我的Mandrivia 2006使用的是xinetd方式已經 有了cvs服務,如果沒開啟服務只需要修改一下cvs檔案,
如果是自己安裝的rpm包的話,在xinetd.d目錄下添加需要啟動的服務:
#cd /etc/xinetd.d
#vi cvspserver

檔案內容:
service cvspserver
{
disable = no
socket_type = stream
wait = no
user = root
env = HOME=
server = /usr/bin/cvs
server_args = -f --allow-root=/cvs pserver
}
12.重新啟動xinetd:

/etc/rc.d/init.d/xinetd restart

13.檢查cvspserver服務是否已經啟動
#netstat -l |grep cvspserver
結果如下:
tcp 0 0 *:cvspserver *:* LISTEN
以上結果全部通過,但是在我的客戶機(redhat9)上執行

14.測試:
ip地址得到:
#ifconfig
#export CVSROOT=:pserver:username@ip:/cvs
這樣你在用戶端就可以直接輸入
#cvs login

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.