设为首页 收藏本站
查看: 593|回复: 0

[经验分享] centos7.x搭建svn server

[复制链接]

尚未签到

发表于 2018-10-20 09:58:54 | 显示全部楼层 |阅读模式
[root@localhost ~]# yum install subversion -y  
Loaded plugins: fastestmirror
  
base                                                     | 3.6 kB     00:00
  
extras                                                   | 3.4 kB     00:00
  
updates                                                  | 3.4 kB     00:00
  
Loading mirror speeds from cached hostfile
  
* base: mirrors.163.com
  
* extras: mirrors.163.com
  
* updates: mirrors.163.com
  
Resolving Dependencies
  
--> Running transaction check
  
---> Package subversion.x86_64 0:1.7.14-10.el7 will be installed
  
--> Processing Dependency: subversion-libs(x86-64) = 1.7.14-10.el7 for package: subversion-1.7.14-10.el7.x86_64
  
--> Processing Dependency: libsvn_wc-1.so.0()(64bit) for package: subversion-1.7.14-10.el7.x86_64
  
--> Processing Dependency: libsvn_subr-1.so.0()(64bit) for package: subversion-1.7.14-10.el7.x86_64
  
--> Processing Dependency: libsvn_repos-1.so.0()(64bit) for package: subversion-1.7.14-10.el7.x86_64
  
--> Processing Dependency: libsvn_ra_svn-1.so.0()(64bit) for package: subversion-1.7.14-10.el7.x86_64
  
--> Processing Dependency: libsvn_ra_neon-1.so.0()(64bit) for package: subversion-1.7.14-10.el7.x86_64
  
--> Processing Dependency: libsvn_ra_local-1.so.0()(64bit) for package: subversion-1.7.14-10.el7.x86_64
  
--> Processing Dependency: libsvn_ra-1.so.0()(64bit) for package: subversion-1.7.14-10.el7.x86_64
  
--> Processing Dependency: libsvn_fs_util-1.so.0()(64bit) for package: subversion-1.7.14-10.el7.x86_64
  
--> Processing Dependency: libsvn_fs_fs-1.so.0()(64bit) for package: subversion-1.7.14-10.el7.x86_64
  
--> Processing Dependency: libsvn_fs_base-1.so.0()(64bit) for package: subversion-1.7.14-10.el7.x86_64
  
--> Processing Dependency: libsvn_fs-1.so.0()(64bit) for package: subversion-1.7.14-10.el7.x86_64
  
--> Processing Dependency: libsvn_diff-1.so.0()(64bit) for package: subversion-1.7.14-10.el7.x86_64
  
--> Processing Dependency: libsvn_delta-1.so.0()(64bit) for package: subversion-1.7.14-10.el7.x86_64
  
--> Processing Dependency: libsvn_client-1.so.0()(64bit) for package: subversion-1.7.14-10.el7.x86_64
  
--> Processing Dependency: libneon.so.27()(64bit) for package: subversion-1.7.14-10.el7.x86_64
  
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: subversion-1.7.14-10.el7.x86_64
  
--> Processing Dependency: libapr-1.so.0()(64bit) for package: subversion-1.7.14-10.el7.x86_64
  
--> Running transaction check
  
---> Package apr.x86_64 0:1.4.8-3.el7 will be installed
  
---> Package apr-util.x86_64 0:1.5.2-6.el7 will be installed
  
---> Package neon.x86_64 0:0.30.0-3.el7 will be installed
  
--> Processing Dependency: libpakchois.so.0()(64bit) for package: neon-0.30.0-3.el7.x86_64
  
---> Package subversion-libs.x86_64 0:1.7.14-10.el7 will be installed
  
--> Running transaction check
  
---> Package pakchois.x86_64 0:0.4-10.el7 will be installed
  
--> Finished Dependency Resolution
  

  
Dependencies Resolved
  

  
================================================================================
  
Package                Arch          Version                 Repository   Size
  
================================================================================
  
Installing:
  
subversion             x86_64        1.7.14-10.el7           base        1.0 M
  
Installing for dependencies:
  
apr                    x86_64        1.4.8-3.el7             base        103 k
  
apr-util               x86_64        1.5.2-6.el7             base         92 k
  
neon                   x86_64        0.30.0-3.el7            base        165 k
  
pakchois               x86_64        0.4-10.el7              base         14 k
  
subversion-libs        x86_64        1.7.14-10.el7           base        921 k
  

  
Transaction Summary
  
================================================================================
  
Install  1 Package (+5 Dependent packages)
  

  
Total download size: 2.3 M
  
Installed size: 8.1 M
  
Downloading packages:
  
(1/6): apr-util-1.5.2-6.el7.x86_64.rpm                     |  92 kB   00:00
  
(2/6): neon-0.30.0-3.el7.x86_64.rpm                        | 165 kB   00:00
  
(3/6): pakchois-0.4-10.el7.x86_64.rpm                      |  14 kB   00:00
  
(4/6): subversion-1.7.14-10.el7.x86_64.rpm                 | 1.0 MB   00:00
  
(5/6): subversion-libs-1.7.14-10.el7.x86_64.rpm            | 921 kB   00:00
  
(6/6): apr-1.4.8-3.el7.x86_64.rpm                          | 103 kB   00:01
  
--------------------------------------------------------------------------------
  
Total                                              1.8 MB/s | 2.3 MB  00:01
  
Running transaction check
  
Running transaction test
  
Transaction test succeeded
  
Running transaction
  
  Installing : apr-1.4.8-3.el7.x86_64                                       1/6
  
  Installing : apr-util-1.5.2-6.el7.x86_64                                  2/6
  
  Installing : pakchois-0.4-10.el7.x86_64                                   3/6
  
  Installing : neon-0.30.0-3.el7.x86_64                                     4/6
  
  Installing : subversion-libs-1.7.14-10.el7.x86_64                         5/6
  
  Installing : subversion-1.7.14-10.el7.x86_64                              6/6
  
  Verifying  : neon-0.30.0-3.el7.x86_64                                     1/6
  
  Verifying  : apr-1.4.8-3.el7.x86_64                                       2/6
  
  Verifying  : subversion-1.7.14-10.el7.x86_64                              3/6
  
  Verifying  : apr-util-1.5.2-6.el7.x86_64                                  4/6
  
  Verifying  : pakchois-0.4-10.el7.x86_64                                   5/6
  
  Verifying  : subversion-libs-1.7.14-10.el7.x86_64                         6/6
  

  
Installed:
  
  subversion.x86_64 0:1.7.14-10.el7
  

  
Dependency Installed:
  
  apr.x86_64 0:1.4.8-3.el7                    apr-util.x86_64 0:1.5.2-6.el7
  
  neon.x86_64 0:0.30.0-3.el7                  pakchois.x86_64 0:0.4-10.el7
  
  subversion-libs.x86_64 0:1.7.14-10.el7
  

  
Complete!
  

  
[root@localhost ~]# svnserve -h
  
usage: svnserve [-d | -i | -t | -X] [options]
  

  
Valid options:
  
  -d [--daemon]            : daemon mode
  
  -i [--inetd]             : inetd mode
  
  -t [--tunnel]            : tunnel mode
  
  -X [--listen-once]       : listen-once mode (useful for debugging)
  
  -r [--root] ARG          : root of directory to serve
  
  -R [--read-only]         : force read only, overriding repository config file
  
  --config-file ARG        : read configuration from file ARG
  
  --listen-port ARG        : listen port
  
                             [mode: daemon, listen-once]
  
  --listen-host ARG        : listen hostname or IP address
  
                             [mode: daemon, listen-once]
  
  -6 [--prefer-ipv6]       : prefer IPv6 when resolving the listen hostname
  
                             [IPv4 is preferred by default. Using IPv4 and IPv6
  
                             at the same time is not supported in daemon mode.
  
                             Use inetd mode or tunnel mode if you need this.]
  
  -c [--compression] ARG   : compression level to use for network transmissions
  
                             [0 .. no compression, 5 .. default,
  
                              9 .. maximum compression]
  
  -M [--memory-cache-size] ARG : size of the extra in-memory cache in MB used to
  
                             minimize redundant operations.
  
                             Default is 128 for threaded and 16 for non-
  
                             threaded mode.
  
                             [used for FSFS repositories only]
  
  --cache-txdeltas ARG     : enable or disable caching of deltas between older
  
                             revisions.
  
                             Default is no.
  
                             [used for FSFS repositories only]
  
  --cache-fulltexts ARG    : enable or disable caching of file contents
  
                             Default is yes.
  
                             [used for FSFS repositories only]
  
  -T [--threads]           : use threads instead of fork [mode: daemon]
  
  --foreground             : run in foreground (useful for debugging)
  
                             [mode: daemon]
  
  --log-file ARG           : svnserve log file
  
  --pid-file ARG           : write server process ID to file ARG
  
                             [mode: daemon, listen-once]
  
  --tunnel-user ARG        : tunnel username (default is current uid's name)
  
                             [mode: tunnel]
  
  -h [--help]              : display this help
  
  --version                : show program version information
  
  -q [--quiet]             : no progress (only errors) to stderr
  

  
[root@localhost ~]# svnserve --version
  
svnserve, version 1.7.14 (r1542130)
  
   compiled Nov 20 2015, 19:25:09
  

  
Copyright (C) 2013 The Apache Software Foundation.
  
This software consists of contributions made by many people; see the NOTICE
  
file for more information.
  
Subversion is open source software, see http://subversion.apache.org/
  

  
The following repository back-end (FS) modules are available:
  

  
* fs_base : Module for working with a Berkeley DB repository.
  
* fs_fs : Module for working with a plain file (FSFS) repository.
  

  
Cyrus SASL authentication is available.
  

  
[root@localhost ~]# which svn
  
/usr/bin/svn
  
[root@localhost ~]# mkdir /var/svn
  
[root@localhost ~]# cd /var/svn/
  
#创建版本库
  
[root@localhost svn]# svnadmin create /var/svn/svnrepos
  
[root@localhost svn]#
  
[root@localhost svn]# ls
  
svnrepos
  
[root@localhost svn]# cd svnrepos/
  
[root@localhost svnrepos]# ls
  
conf  db  format  hooks  locks  README.txt
  
[root@localhost svnrepos]# cat README.txt
  
This is a Subversion repository; use the 'svnadmin' tool to examine
  
it.  Do not add, delete, or modify files here unless you know how
  
to avoid corrupting the repository.
  

  
Visit http://subversion.apache.org/ for more information.
  
[root@localhost svnrepos]# cd conf/
  
[root@localhost conf]# ls
  
authz  passwd  svnserve.conf
  
[root@localhost conf]# vim 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
  

  
#添加admin用户
  
admin = 123456
  
[root@localhost conf]# vim authz
  
### This file is an example authorization file for svnserve.
  
### Its format is identical to that of mod_authz_svn authorization
  
### files.
  
### As shown below each section defines authorizations for the path and
  
### (optional) repository specified by the section name.
  
### The authorizations follow. An authorization line can refer to:
  
###  - a single user,
  
###  - a group of users defined in a special [groups] section,
  
###  - an alias defined in a special [aliases] section,
  
###  - all authenticated users, using the '$authenticated' token,
  
###  - only anonymous users, using the '$anonymous' token,
  
###  - anyone, using the '*' wildcard.
  
###
  
### A match can be inverted by prefixing the rule with '~'. Rules can
  
### grant read ('r') access, read-write ('rw') access, or no access
  
### ('').
  

  
[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
  

  
# [/foo/bar]
  
# harry = rw
  
# &joe = r
  
# * =
  

  
# [repository:/baz/fuz]
  
# @harry_and_sally = rw
  
# * = r
  
#
  
#添加新建的用户admin,并授予rw权限
  
[/]
  
admin = rw
  

  
[root@localhost conf]# cat svnserve.conf
  
### This file controls the configuration of the svnserve daemon, if you
  
### use it to allow access to this repository.  (If you only allow
  
### access through http: and/or file: URLs, then this file is
  
### irrelevant.)
  

  
### Visit http://subversion.apache.org/ for more information.
  

  
[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
  
anon-access = none
  
# 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 = /var/svn/svnrepos
  
### 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).
  
# force-username-case = none
  

  
[sasl]
  
### This option specifies whether you want to use the Cyrus SASL
  
### library for authentication. Default is false.
  
### This section will be ignored if svnserve is not built with Cyrus
  
### SASL support; to check, run 'svnserve --version' and look for a line
  
### reading 'Cyrus SASL authentication is available.'
  
# use-sasl = true
  
### These options specify the desired strength of the security layer
  
### that you want SASL to provide. 0 means no encryption, 1 means
  
### integrity-checking only, values larger than 1 are correlated
  
### to the effective key length for encryption (e.g. 128 means 128-bit
  
### encryption). The values below are the defaults.
  
# min-encryption = 0
  
# max-encryption = 256
  

  
#启动svn
  
[root@localhost conf]# svnserve -d -r /var/svn/svnrepos/
  
[root@localhost conf]# ps -ef|grep svn
  
root      9114     1  0 16:06 ?        00:00:00 svnserve -d -r /var/svn/svnrepos/
  
root      9116  8214  0 16:06 pts/0    00:00:00 grep --color=auto svn
  
[root@localhost conf]# netstat -ntlp
  
Active Internet connections (only servers)
  
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
  
tcp        0      0 0.0.0.0:3690            0.0.0.0:*               LISTEN      9114/svnserve
  
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1049/sshd
  
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1282/master
  
tcp6       0      0 :::3306                 :::*                    LISTEN      26795/mysqld
  
tcp6       0      0 :::8080                 :::*                    LISTEN      4538/java
  
tcp6       0      0 :::22                   :::*                    LISTEN      1049/sshd
  
tcp6       0      0 ::1:25                  :::*                    LISTEN      1282/master
  
[root@localhost conf]# cd ..
  
[root@localhost svnrepos]# ls
  
conf  db  format  hooks  locks  README.txt
  
[root@localhost svnrepos]# tree
  
.
  
├── conf
  
│   ├── authz
  
│   ├── passwd
  
│   └── svnserve.conf
  
├── db
  
│   ├── current
  
│   ├── format
  
│   ├── fsfs.conf
  
│   ├── fs-type
  
│   ├── min-unpacked-rev
  
│   ├── revprops
  
│   │   └── 0
  
│   │       └── 0
  
│   ├── revs
  
│   │   └── 0
  
│   │       └── 0
  
│   ├── transactions
  
│   ├── txn-current
  
│   ├── txn-current-lock
  
│   ├── txn-protorevs
  
│   ├── uuid
  
│   └── write-lock
  
├── format
  
├── hooks
  
│   ├── post-commit.tmpl
  
│   ├── post-lock.tmpl
  
│   ├── post-revprop-change.tmpl
  
│   ├── post-unlock.tmpl
  
│   ├── pre-commit.tmpl
  
│   ├── pre-lock.tmpl
  
│   ├── pre-revprop-change.tmpl
  
│   ├── pre-unlock.tmpl
  
│   └── start-commit.tmpl
  
├── locks
  
│   ├── db.lock
  
│   └── db-logs.lock
  
└── README.txt
  

  
10 directories, 27 files
  

  
#停止SVN命令
  
killall svnserve



运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-623936-1-1.html 上篇帖子: centos7.x搭建svn server 下篇帖子: PLSQL 之SQL分类和动态SQL
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表