安装 subversion 指南

Web、Mail、Ftp、DNS、Proxy、VPN、Samba、LDAP 等基础网络服务
头像
oneleaf
论坛管理员
帖子: 10441
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04

安装 subversion 指南

#1

帖子 oneleaf » 2005-09-09 15:16

sudo apt-get install subversion
sudo apt-get install libapache2-svn
sudo mkdir -p /svn
sudo svnadmin create /svn
sudo chown -R www-data:www-data /svn

编辑 /etc/apache2/mods-available/dav_svn.conf 打开仓库

sudo /etc/init.d/apache2 restart
完成!

如果你是通过squid代理出去的,请修改
/etc/squid/squid.conf

增加:
extension_methods REPORT MERGE MKACTIVITY CHECKOUT
当净其意如虚空,远离妄想及诸取,令心所向皆无碍
头像
oneleaf
论坛管理员
帖子: 10441
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04

#2

帖子 oneleaf » 2005-09-09 23:05

关于帐号管理使用

htpasswd2 -c /etc/apache2/dav_svn.passwd username

来创建一个新的帐号文件

使用

htpasswd2 /etc/apache2/dav_svn.passwd username

来增加用户。

因此它的帐号是与系统无关的方便管理。
当净其意如虚空,远离妄想及诸取,令心所向皆无碍
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

#3

帖子 eexpress » 2006-04-25 15:52

按oneleaf的修改成这样。/etc/apache2/mods-available/dav_svn.conf

代码: 全选

<VirtualHost *>
ServerAdmin webmaster@localhost
ServerName svn.exp.org
#ServerAlias svn.exp.org
#CustomLog /var/log/apache2/svn.exp.org-access.log combined

<Location />
   DAV svn
   SVNPath /home/exp/svn
   AuthType Basic
   AuthName "Subversion Repository"
   AuthUserFile /etc/apache2/dav_svn.passwd
   AuthzSVNAccessFile /etc/apache2/dav_svn.authz

  <LimitExcept GET PROPFIND OPTIONS REPORT>
    Require valid-user
  </LimitExcept> 

</Location>
</VirtualHost>
还执行了,svnserve -d -T -r /home/exp/svn

http://127.0.0.1 显示成这样

代码: 全选

Index of /
 Name                    Last modified      Size  Description
 svn/                    25-Apr-2006 15:04    -   
Apache/2.0.55 (Ubuntu) DAV/2 SVN/1.3.0 Server at 127.0.0.1 Port 80
http://svn.ubuntu.org.cn/ 显示是这样。

代码: 全选

Revision 351: /
home/
test/
Powered by Subversion version 1.2.0 (r14790
● 鸣学
头像
oneleaf
论坛管理员
帖子: 10441
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04

#4

帖子 oneleaf » 2006-04-25 15:56

:D
只能将这个修改在 /etc/apache2/sites-enabled/default

/etc/apache2/mods-available/dav_svn.conf 这个文件不要修改。
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

格式完全不同,不敢改了。

#5

帖子 eexpress » 2006-04-25 16:35

/etc/apache2/sites-enabled$ ll
总计 0
lrwxrwxrwx 1 root root 36 2006-04-25 14:02 000-default -> /etc/apache2/sites-available/default

$ cd /etc/apache2/sites-available/
$ sudo vi default

代码: 全选

NameVirtualHost *
<VirtualHost *>
	ServerAdmin webmaster@localhost
	
	DocumentRoot /var/www
	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>
	<Directory /var/www/>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride None
		Order allow,deny
		allow from all
		# Uncomment this directive is you want to see apache2's
		# default start page (in /apache2-default) when you go to /
		#RedirectMatch ^/$ /apache2-default/
	</Directory>

	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
	<Directory "/usr/lib/cgi-bin">
		AllowOverride None
		Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
		Order allow,deny
		Allow from all
	</Directory>

	ErrorLog /var/log/apache2/error.log

	# Possible values include: debug, info, notice, warn, error, crit,
	# alert, emerg.
	LogLevel warn

	CustomLog /var/log/apache2/access.log combined
	ServerSignature On

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>
● 鸣学
头像
oneleaf
论坛管理员
帖子: 10441
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04

#6

帖子 oneleaf » 2006-04-25 17:58

就是修改这个。
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

#7

帖子 eexpress » 2006-04-26 13:36

修改了,不知道合oneleaf心意不 :lol: 。反正我的是

代码: 全选

Forbidden

You don't have permission to access / on this server.
:roll:
附件
sites-available.tar.gz
(1.46 KiB) 已下载 255 次
● 鸣学
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

不知道这个是不是要设置。

#8

帖子 eexpress » 2006-04-26 19:45

viewtopic.php?t=3517&highlight=svn+apache

代码: 全选

在Apache2配置文件/etc/apache2/apache2.conf中新建一个虚拟主机,并将它指向/home/svn。配置信息节选: 

<Location /faq> 
DAV svn 
SVNPath /home/svn/faq 
AuthType Basic 
AuthName "Documentation Team Repository" 
AuthUserFile /etc/subversion/passwd 
<LimitExcept GET PROPFIND OPTIONS REPORT> 
Require valid-user 
</LimitExcept> 
</Location> 
● 鸣学
greenwoodboy
帖子: 88
注册时间: 2005-04-15 15:31

#9

帖子 greenwoodboy » 2006-04-29 9:34

我配置了一个,能check out ,但不能提交
fuqiang
帖子: 73
注册时间: 2006-05-12 13:15
来自: 哈尔滨
联系:

#10

帖子 fuqiang » 2006-05-16 10:31

权限控制
lb_bn
帖子: 1261
注册时间: 2007-02-25 16:56

#11

帖子 lb_bn » 2007-02-27 9:14

谢谢分享。。。。
头像
forrid
帖子: 659
注册时间: 2007-04-23 17:40

#12

帖子 forrid » 2007-07-10 0:24

好像可以

吾生也有涯,而知也无涯,以有涯随无涯,SB啊~~~~~~~~~~
duanyong
帖子: 73
注册时间: 2007-05-17 9:38

Re: 安装 subversion 指南

#13

帖子 duanyong » 2007-12-14 16:25

oneleaf 写了:sudo apt-get install subversion
sudo apt-get install libapache2-svn
sudo mkdir -p /svn
sudo svnadmin create /svn
sudo chown -R www-data:www-data /svn

编辑 /etc/apache2/mods-available/dav_svn.conf 打开仓库

sudo /etc/init.d/apache2 restart
完成!

如果你是通过squid代理出去的,请修改
/etc/squid/squid.conf

增加:
extension_methods REPORT MERGE MKACTIVITY CHECKOUT
楼主,你是做笔记,还是给新手看呢?
lorenxu
帖子: 49
注册时间: 2007-10-29 12:04

#14

帖子 lorenxu » 2007-12-14 16:37

可以发到外部网吗?
xygz
帖子: 61
注册时间: 2007-09-09 20:08

#15

帖子 xygz » 2008-03-23 16:34

我现在配置完成,在本地用svn co file:///home/svn/proj1
svn co http://localhost/svn/proj1
都可以正常,但是在远程用TORTOISESVN就不能连接,在apache2/access.log里看到一串的
192.168.1.132 - xygz [23/Mar/2008:16:16:24 +0800] "PROPFIND /svn/proj1/!svn/bc/0 HTTP/1.1" 207 323 "-" "SVN/1.4.4 (r25188) neon/0.26.3"
类似这样的,然后就没有反应了,如果客户端强行关闭tortoise svn,那么LOG里还会出来XMP PARSER ERROR STATUS=20014,没招了,不知道什么问题,好多地方也有人类似的问题,但找不出解决方法来
回复