2009年11月25日水曜日

centos上での正しいcvsサーバの構築

世の中にはいろいろな情報が溢れている。

いろいろまどわされた。以下の情報は確実に正しい。
○今回の環境
OS :Linux 2.6.18-164.6.1.el5 #1 SMP Tue Nov 3 16:18:27 EST 2009 GNU/Linux
ディストリビューション:CentOS 5.4
CVS :cvs-1.11.22-7.el5

nriのガイドを参考にし作成(cvs_redhat.pdf)

1.rootに変更する
2.cvsのバージョンを確認する
    rpm -q cvs
    ※インストールされていない場合は下記の用なコマンドでインストールする。

    rpm -ivh cvs-1.11.1p1-7.i386.rpm

3.cvsリポジトリを作成する
    mkdir /usr/local/cvsrepo

4.CVSリポジトリの初期化を行う
    cvs -d /usr/local/cvsrepo init

5.サービスの確認
基本的には初期設定されているが、変更を行いたい場合は下記のファイルを修正する。
/etc/services

    :
    cvspserver 2401/tcp # CVS client/server operations
    cvspserver 2401/udp # CVS client/server operations
    :

6./etc/xinetd.d/cvspserver の登録
下記のファイルは最初はないはずなので新規作成する。

/etc/xitetd.d/cvspserver

中身は下記(ディレクトリは環境に併せて修正すること)

    # cvspserver
    service cvspserver
    {
    socket_type = stream
    wait = no
    protocol = tcp
    user = root
    server = /usr/bin/cvs
    server_args =-f --allow-root=/usr/local/cvsrepo pserver
    disable = no
    }

保存終了したら、ファイルの権限変更を行う
    chmod 644 /etc/xinetd.d/cvspserver

7.xinetd の再起動を行う
    /sbin/service xinetd restart

8.ログイン確認を行う
下記コマンドを入力し、rootのいつも使用しているパスワード入力する。

    cvs -d ':pserver:root@localhost:/usr/local/cvsrepo' login

9.シスログの確認
/var/log/messagesが下記のようになっているかを確認する。

    Dec 16 15:35:43 cvstst xinetd[1669]: xinetd Version 2002.03.28 started with libwrap options compiled in.
    Dec 16 15:35:43 cvstst xinetd[1669]: Started working: 1 available services

これで導入はひとまず成功。

0 件のコメント:

コメントを投稿