Home | 简体中文 | 繁体中文 | 杂文 | Search | ITEYE 博客 | OSChina 博客 | Facebook | Linkedin | 知乎专栏 | Email

第 189 章 Invoking the Server

目录

189.1. Installing
189.1.1. CentOS
189.1.2. CentOS
189.2. standalone “daemon” process
189.2.1. starting subversion for debian/ubuntu
189.2.2. starting subversion daemon script for CentOS/Radhat
189.3. classic Unix-like inetd daemon
189.4. hooks
189.4.1. post-commit
189.5. WebDav
189.5.1. davfs2 - mount a WebDAV resource as a regular file system

配置开发环境版本控制Subversion

Squid + Subversion 请参考Squid一节

189.1. Installing

189.1.1. CentOS

过程 189.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
    					

189.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