日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

Linux上Svn环境搭建

發布時間:2025/3/11 linux 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Linux上Svn环境搭建 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

一般情況下,Linux都是自帶SVN環境的。

查看svn是否安裝了

[14:50:28][root@VM60 ~]# rpm -aq subversion
[14:50:30]subversion-1.6.11-9.el6_4.x86_64

[14:52:01][root@VM60 ~]# whereis svn
[14:52:01]svn: /usr/bin/svn /usr/share/man/man1/svn.1.gz


[14:55:59][root@VM60 ~]# svnserve --version
[14:55:59]svnserve, version 1.6.11 (r934486)
[14:55:59] ? compiled Apr ?2 2013, 08:56:54


創建存放代碼的svn文件夾

[15:21:34][root@VM60 opt]# mkdir -p svn/data
[15:21:53][root@VM60 opt]# mkdir -p svn/svnpasswd


啟動svnserve

[15:22:15][root@VM60 opt]# svnserve -d -r svn/data/

啟動svn的命令用svnserve -d -r安裝路徑 -d表示svnserve.exe作為服務程序運行在后臺;-r表示將svn的目錄當作根目錄。


查看是否啟動成功

[15:23:33][root@VM60 opt]# ps -ef|grep svn|grep -v grep
[15:23:33]root ? ? 24891 ? ? 1 ?0 07:19 ? ? ? ? ?00:00:00 svnserve -d -r svn/data/

[16:25:14][root@VM60 ~]# netstat -lnt|grep 3690
[16:25:14]tcp ? ? ? ?0 ? ? ?0 0.0.0.0:3690 ? ? ? ? ? ? ? ?0.0.0.0:* ? ? ? ? ? ? ? ? ? LISTEN ? ? ?


創建項目庫

[15:27:03][root@VM60 opt]# svnadmin create svn/data/qualityMonitor



[15:27:13][root@VM60 ~]# cd /opt/svn/data/
[15:27:14][root@VM60 data]# ll
[15:27:14]total 4
[15:27:14]drwxr-xr-x 6 root root 4096 Nov 17 07:24 qualityMonitor



[15:27:16][root@VM60 data]# cd qualityMonitor/
[15:27:17][root@VM60 qualityMonitor]# ll
[15:27:17]total 24
[15:27:17]drwxr-xr-x 2 root root 4096 Nov 17 07:24 conf
[15:27:17]drwxr-sr-x 6 root root 4096 Nov 17 07:24 db
[15:27:17]-r--r--r-- 1 root root ? ?2 Nov 17 07:24 format
[15:27:17]drwxr-xr-x 2 root root 4096 Nov 17 07:24 hooks
[15:27:17]drwxr-xr-x 2 root root 4096 Nov 17 07:24 locks
[15:27:17]-rw-r--r-- 1 root root ?229 Nov 17 07:24 README.txt



[15:27:42][root@VM60 qualityMonitor]# cd conf/
[15:27:42][root@VM60 conf]# ll
[15:27:42]total 12
[15:27:42]-rw-r--r-- 1 root root 1080 Nov 17 07:24 authz
[15:27:42]-rw-r--r-- 1 root root ?309 Nov 17 07:24 passwd
[15:27:42]-rw-r--r-- 1 root root 2279 Nov 17 07:24 svnserve.conf


編輯配置文件

[15:31:27][root@VM60 conf]# vi 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.tigris.org/ for more information.


[general]
### These options control access to the repository for unauthenticated
### and authenticated users. ?Valid values are "write", "read",
### and "none". ?The sample settings below are the defaults.
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 =/opt/svn/svnpasswd/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 =/opt/svn/svnpasswd/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


[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



[15:45:55][root@VM60 conf]# cp authz passwd /opt/svn/svnpasswd
[15:54:57][root@VM60 conf]# cd /opt/svn/svnpasswd/


修改掉權限,安全措施

[15:46:04][root@VM60 svnpasswd]# chmod 700 *
[15:46:06][root@VM60 svnpasswd]# ll
[15:46:06]total 8
[15:46:06]-rwx------ 1 root root 1080 Nov 17 07:43 authz
[15:46:06]-rwx------ 1 root root ?309 Nov 17 07:43 passwd


配置用戶名密碼

[15:46:45][root@VM60 svnpasswd]# vi 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下面添加用戶名密碼

[users]
# harry = harryssecret
# sally = sallyssecret


liwen.xu=liwen.xu
ting.chen=ting.chen
erhuan.deng=erhuan.deng
miaogen.zeng=miaogen.zeng


配置項目用戶權限

[15:50:07][root@VM60 svnpasswd]# vi 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
dev=liwen.xu,ting.chen,erhuan.deng,miaogen.zeng




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


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

設置項目用戶權限。格式必須這樣寫。

[qualityMonitor:/]
@dev=rw


重啟SVNserve

[15:57:43][root@VM60 opt]# pkill svnserve


[15:57:57][root@VM60 opt]# svnserve -d -r svn/data/

[16:25:14][root@VM60 ~]# netstat -lnt|grep 3690
[16:25:14]tcp ? ? ? ?0 ? ? ?0 0.0.0.0:3690 ? ? ? ? ? ? ? ?0.0.0.0:* ? ? ??


??如果修改了 ?passwd和authz 文件不需要重啟,修改了svnserve.conf ?必須重啟才能生效。


在Linux防火墻中添加3690端口可以通過。

先查看防火墻是否開著,如果關閉的,就不用配置了

service iptables status


編輯/etc/sysconfig/iptables
-A INPUT -p tcp -m tcp --dport 3690 ?-j ACCEPT
保存在前面部分
再重啟:
service iptables restart





創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎

總結

以上是生活随笔為你收集整理的Linux上Svn环境搭建的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。