Home | 簡體中文 | 繁體中文 | 雜文 | Search | ITEYE 博客 | OSChina 博客 | Facebook | Linkedin | Email

第 13 章 Invoking the Server

目錄

13.1. Installing
13.1.1. CentOS
13.1.2. CentOS
13.2. standalone “daemon” process
13.2.1. starting subversion for debian/ubuntu
13.2.2. starting subversion daemon script for CentOS/Radhat
13.3. classic Unix-like inetd daemon
13.4. hooks
13.4.1. post-commit
13.5. WebDav
13.5.1. davfs2 - mount a WebDAV resource as a regular file system

配置開發環境版本控制Subversion

Squid + Subversion 請參考Squid一節

13.1. Installing

13.1.1. CentOS

過程 13.1. subversion

  1. installation

    $ sudo apt-get install subversion
    $ sudo apt-get install subversion
    					
  2. create svn group and svnroot user

    $ sudo groupadd svn
    $ sudo adduser svnroot --ingroup svn
    					
  3. create repository

    $ svnadmin create /home/svnroot/test
    					
  4. testing

    svnroot@netkiller:~$ svnserve -d --foreground -r /home/svnroot/
    					

    check out

    neo@netkiller:/tmp$ svn list svn://localhost/test

    you may see some file and directory

    neo@netkiller:/tmp$ ls test/.svn/
    entries  format  prop-base  props  text-base  tmp
    					
  5. configure

    $ vim repositories/conf/svnserve.conf

    [general]
    anon-access = read
    auth-access = write
    password-db = passwd
    # authz-db = authz
    # realm = My First Repository
    					

    $ vim repositories/conf/passwd

    [users]
    # harry = harryssecret
    # sally = sallyssecret
    neo = chen
    					

    如果不允許匿名用戶checkout代碼,配置檔案這樣寫anon-access = none

    [general]
    anon-access = none
    auth-access = write
    					
  6. firewall

    $ sudo ufw allow svn
    					

13.1.2. CentOS

# yum install xinetd
# yum install subversion

# mkdir -p /opt/svnroot
			

xinetd 配置

# vim /etc/xinetd.d/svn
service svn
{
    disable = no
    port = 3690
    socket_type = stream
    protocol = tcp
    wait = no
    user = svnroot
    server = /usr/bin/svnserve
    server_args = -i -r /opt/svnroot
}

# /etc/init.d/xinetd restart
Stopping xinetd:                                           [FAILED]
Starting xinetd:                                           [  OK  ]

# tail /var/log/messages | grep xinetd
May  5 18:57:20 SZVM42-C1-02 yum: Installed: 2:xinetd-2.3.14-16.el5.i386
May  5 18:59:22 SZVM42-C1-02 xinetd[4558]: Unknown user: svnroot [file=/etc/xinetd.d/svn] [line=8]
May  5 18:59:22 SZVM42-C1-02 xinetd[4558]: Error parsing attribute user - DISABLING SERVICE

[file=/etc/xinetd.d/svn] [line=8]
May  5 18:59:22 SZVM42-C1-02 xinetd[4558]: xinetd Version 2.3.14 started with libwrap loadavg labeled-networking

options compiled in.
May  5 18:59:22 SZVM42-C1-02 xinetd[4558]: Started working: 0 available services
			

service 名字必須與 /etc/services中定義的名字相同,否則將不能啟動,同時在/var/log/message中會提示如下

May  4 14:33:08 www xinetd[5656]: service/protocol combination not in /etc/services: subversion/tcp
May  4 14:33:08 www xinetd[5656]: xinetd Version 2.3.14 started with libwrap loadavg labeled-networking options compiled in.
May  4 14:33:08 www xinetd[5656]: Started working: 0 available services
May  4 14:33:33 www pulseaudio[21913]: sink-input.c: Failed to create sink input: too many inputs per sink.
May  4 14:33:33 www pulseaudio[21913]: sink-input.c: Failed to create sink input: too many inputs per sink.
May  4 14:33:33 www pulseaudio[21913]: sink-input.c: Failed to create sink input: too many inputs per sink.
May  4 14:33:33 www pulseaudio[21913]: sink-input.c: Failed to create sink input: too many inputs per sink.
May  4 14:33:33 www pulseaudio[21913]: sink-input.c: Failed to create sink input: too many inputs per sink.
May  4 14:33:33 www pulseaudio[21913]: sink-input.c: Failed to create sink input: too many inputs per sink.
May  4 14:33:33 www pulseaudio[21913]: sink-input.c: Failed to create sink input: too many inputs per sink.
May  4 14:33:33 www pulseaudio[21913]: sink-input.c: Failed to create sink input: too many inputs per sink.
May  4 14:33:41 www xinetd[5656]: Exiting...
May  4 14:33:41 www xinetd[5676]: xinetd Version 2.3.14 started with libwrap loadavg labeled-networking options compiled in.
May  4 14:33:41 www xinetd[5676]: Started working: 1 available service
			
comments powered by Disqus