linux svn server 创建总结

整理记录以作备忘。

1.svn 服务器是否已经安装(本人环境已安装过)

 验证: $svnserve --version


2.在需要设置的路径下创建相关文件夹 创建版本库:

  $mkdir ./svn

  $svnadmin create /home/.../svn/luckysvn  (luckysvn: 版本库名称)


3.svn config

    创建版本库后,会在版本库下面的conf目录下生成3个配置文件:

    authz  passwd  svnserve.conf

   这三个如果配置不对,就不能用,我这里做了个最简单的配置:

a. svnserve.conf

   [general]
### The anon-access and auth-access options control access to the
### repository for unauthenticated (a.k.a. anonymous) users and
### authenticated users, respectively.
### Valid values are "write", "read", and "none".
### Setting the value to "none" prohibits both reading and writing;
### "read" allows read-only access, and "write" allows complete 
### read/write access to the repository.
### The sample settings below are the defaults and specify that anonymous
### users have read-only access to the repository, while authenticated
### users have read and write access to the repository.
anon-access = read
auth-access = write

### The password-db option controls the location of the password
### database file.  Unless you specify a path starting with a /,
### the file's location is relative to the directory containing
### this configuration file.
### If SASL is enabled (see below), this file will NOT be used.
### Uncomment the line below to use the default password file.
password-db = passwd
### The authz-db option controls the location of the authorization
### rules for path-based access control.  Unless you specify a path
### starting with a /, the file's location is relative to the the
### directory containing this file.  If you don't specify an
### authz-db, no path-based access control is done.
### Uncomment the line below to use the default authorization file.
authz-db = authz
### This option specifies the authentication realm of the repository.
### If two repositories have the same authentication realm, they should
### have the same password database, and vice versa.  The default realm
### is repository's uuid.
# realm = My First Repository
### The force-username-case option causes svnserve to case-normalize
### usernames before comparing them against the authorization rules in the
### authz-db file configured above.  Valid values are "upper" (to upper-
### case the usernames), "lower" (to lowercase the usernames), and
### "none" (to compare usernames as-is without case conversion, which
### is the default behavior).

b.passwd

### This file is an example password file for svnserve.
### Its format is similar to that of svnserve.conf. As shown in the
### example below it contains one section labelled [users].
### The name and password for each user follow, one account per line.


[users]
# harry = harryssecret
# sally = sallyssecret
lucky = lucky


c.authz:

      [aliases] 
      # joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average 
 
[groups] 
# harry_and_sally = harry,sally 
# harry_sally_and_joe = harry,sally,&joe 
user = lucky
# [/foo/bar] 
# harry = rw 
# &joe = r 
# * = 
[/] 
@user = rw 

# [repository:/baz/fuz] 
# @harry_and_sally = rw 
# * = r  

4.启动和停止svn服务:

$svnserve -d -r /home/.../extern_data/sharp_g2_precode/

       -d表示后台运行

       -r 指定根目录是 /home/.../extern_data/sharp_g2_precode/

2)停止SVN服务:

ps -aux |grep svn

kill -9 进程杀掉


5.通过以下指令来checkout:

     $svn checkout svn://192.168.1.3/.../luckysvn


6.上传code。


7.svnserve: E000098: 不能绑定服务器套接字: Address already in use

      原因:svnserve进程已经启动。

      处理:ps -aux|grep svn 查看svnserve进程的pid

                  kill -9 xxx

                  svnserve -d -r /xxx/xxx/xxx/

8.查看不了log信息

$ svn log -l1
------------------------------------------------------------------------
r2 | (没有作者信息) | (没有时间信息) | 1 行

       处理:只需要修改svnserver.conf文件里面:
      anon-access = read -->修改为 anon-access = none。

你可能感兴趣的:(linux,SVN,server,创建)