我以获得无尽的Linux SVN系统知识的奥义,我预知你可能会在Linux SVN安装中遇到问题FEDORA下,下面就这就来讲术Linux SVN系统安装。Linux SVN的安装以及配置
step 1
安装subversion yum install subversion
step 2
安装apache的Linux SVN模块yum install mod_dav_svn
step 3
建立Linux SVN仓库文件mkdir /svn
step 4
建立Linux SVN库并修改/svn用户组和用户svnadmin create /svn/repos/chown -R apache.apache /svn
step 5
编辑/svn/repos/conf/svnserve.confvi /svn/repos/conf/svnserve.conf
5-1.把#anon-access = read #auth-access = write改为anon-access = none(如果此处不设置为none的话,则连结SVN时会出现错误“Read access denied for root of edit”)auth-access = write
5-2.把#password-db = passwd改为password-db = passwd
5-3.把#authz-db = authz改为authz-db = authz(此处设置后方可设置svn访问读写权限的配置文件“/svn/repos/conf/authz”)重点注意:”svn: /svn/repos/conf/svnserve.conf:12: Option expected“发生时,原因是:是因为subversion读取配置文件svnserve.conf时,无法识别有前置空格的配置,因此前面不能有空格。
step 6
Linux SVN增加用户密码,并设置访问权限
6-1.vi /svn/repos/conf/passwd如[users]#user = passwordsvnuser = svnusertest = test
6-2.vi /svn/repos/conf/authz追加下记文字[/]svnuser = rw[/]test = r
step 7
把每次提交的文件都和/var/www/html同步,那样,就可以直接访问了信件一个post-commit文件cp post-commit.tmpl post-commitvi /svn/repos/hooks/post-commit写入以下内容:#!/bin/shexport LANG=en_US.UTF-8svn update /var/www/html --username svnuser --password svnusersvn update /var/www/html --username test --password test并且,把这个文件改为777 首先,先在服务器端/var/www/html checkout以后,每次更新就能够向/var/www/html添加了chmod 777 post-commitchown apache.apache post-commit
Step 8
运行subversion服务(非必要)vi /etc/rc.local加入如下命令
#!/bin/sh
#
# This script. will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style. init stuff.
touch /var/lock/subsys/localsvnserve -d -r /svn/repos
step 9
设置apache的Linux SVN配置文件vi /etc/httpd/conf.d/subversion.conf<Location /repos>DAV svn SVNParentPath /svn
# # Limit write permission to list of valid users.
# <LimitExcept GET PROPFIND OPTIONS REPORT>
# # Require SSL connection for password protection.
# # SSLRequireSSL
#
# AuthType Basic
# AuthName "Authorization Realm"
# AuthUserFile /path/to/passwdfile
# Require valid-user
# </LimitExcept></Location>
把对应的#号去掉,并修改路径,改为如上的。
step 10
重启服务器svnserve --daemon --root=/svn --listen-port=3690
step 11
建立project svnProjectmkdir /tmp/svnProjectmkdir /svn/repos/svnProjectsvn import /tmp/svnProject file:///svn/repos/svnProject -m "initial import"
step 12
在服务器checkout一次svn checkout svn://127.0.0.1/repos /var/www/html
step 13
OK了可以用别的机器访问服务器,例如内网IP:192.168.1.226svn://192.168.1.226/repos/svnProjecttest项目的地址http://192.168.1.226/svnProject以后commit到数据仓库的代码,和192.168.1.222服务器的/var/www/html里面的同步了另外,可以每个数据仓库一个项目工程,自己进行相关设置就是了
【编辑推荐】