在hiweed-1.0final系统下搭建eclipse开发环境
下载 eclipse europa、安装到$HOME下
下载 subeclipse,解压到$ECLILPSE_HOME
sudo apt-get install subversion subversion-tools libapache2-svn
建立仓库 sudo mkdir /var/www/svn
初始化仓库sudo svnadmin create /var/www/svn
导入下载的lumaqq的svn下的源代码包:
(没有设置svn权限时) sudo svn import -m "first" . file:///var/www/svn
启动svn自带服务器 sudo svnserve -d -r /var/www/svn后就可以通过SVN客户端checkout checkin了。
如果需要挂到apache2服务器 下sudo vi /etc/apache2/mods-enables/dav_svn.conf修改如下:
# dav_svn.conf - Example Subversion/Apache configuration
#
# For details and further options see the Apache user manual and
# the Subversion book.
# <Location URL> ... </Location>
# URL controls how the repository appears to the outside world.
# In this example clients access the repository as http://hostname/svn/
<Location /svn>
# Uncomment this to enable the repository,
DAV svn
# Set this to the path to your repository
SVNPath /var/svn
# The following allows for basic http authentication. Basic authentication
# should not be considered secure for any particularly rigorous definition of
# secure.
# to create a passwd file
# # rm -f /etc/apache2/dav_svn.passwd
# # htpasswd2 -c /etc/apache2/dav_svn.passwd dwhedon
# New password:
# Re-type new password:
# Adding password for user dwhedon
# #
# Uncomment the following 3 lines to enable Basic Authentication
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd
# Uncomment the following line to enable Authz Authentication
# AuthzSVNAccessFile /etc/apache2/dav_svn.authz
# The following three lines allow anonymous read, but make
# committers authenticate themselves.
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
</Location>
重启apache:sudo apache2 -k restart
然后就可以通过 http://localhost/访问svn仓库了: svn import <from> http://localhost/
下载 eclipse europa、安装到$HOME下
下载 subeclipse,解压到$ECLILPSE_HOME
sudo apt-get install subversion subversion-tools libapache2-svn
建立仓库 sudo mkdir /var/www/svn
初始化仓库sudo svnadmin create /var/www/svn
导入下载的lumaqq的svn下的源代码包:
(没有设置svn权限时) sudo svn import -m "first" . file:///var/www/svn
启动svn自带服务器 sudo svnserve -d -r /var/www/svn后就可以通过SVN客户端checkout checkin了。
如果需要挂到apache2服务器 下sudo vi /etc/apache2/mods-enables/dav_svn.conf修改如下:
# dav_svn.conf - Example Subversion/Apache configuration
#
# For details and further options see the Apache user manual and
# the Subversion book.
# <Location URL> ... </Location>
# URL controls how the repository appears to the outside world.
# In this example clients access the repository as http://hostname/svn/
<Location /svn>
# Uncomment this to enable the repository,
DAV svn
# Set this to the path to your repository
SVNPath /var/svn
# The following allows for basic http authentication. Basic authentication
# should not be considered secure for any particularly rigorous definition of
# secure.
# to create a passwd file
# # rm -f /etc/apache2/dav_svn.passwd
# # htpasswd2 -c /etc/apache2/dav_svn.passwd dwhedon
# New password:
# Re-type new password:
# Adding password for user dwhedon
# #
# Uncomment the following 3 lines to enable Basic Authentication
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd
# Uncomment the following line to enable Authz Authentication
# AuthzSVNAccessFile /etc/apache2/dav_svn.authz
# The following three lines allow anonymous read, but make
# committers authenticate themselves.
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
</Location>
重启apache:sudo apache2 -k restart
然后就可以通过 http://localhost/访问svn仓库了: svn import <from> http://localhost/
常见问题参考
基于svnserve的服务器,权限文件authz配置的常见问题及解答
最近在我用Subversion论坛(
http://www.iUseSVN.com/bbs)经常有人提到这样的问题:
为什么我的客户端没有写权限?
为什么我的权限没有起作用?
总结他们的配置,发现
都是用svnserve作为服务器,
都在svnserve.conf中使用了authz-db选项
原因可能如下:
1,配置authz时,没有注意svnserve启动参数-r所指定的目录。
这里有两种情况:
A:-r直接指定到版本库(称之为单库svnserve方式)
比如,有一个库project1,位于D:/svn/project1
使用以下命令启动svnserve
在这种情况下,一个svnserve只能为一个版本库工作
authz文件如果配置成下面这样就是错的,
应该配置成
因为[project1:/]表示库project1的根目录,而按上面的启动参数,是没有库的概念的。
使用类似这样的URL:svn://192.168.0.1/ 即可访问project1
B:-r指定到版本库的上级目录(称之为多库svnserve方式)
同样,有一个库project1,位于D:/svn/project1
如果使用以下命令启动svnserve
这种情况,一个svnserve可以为多个版本库工作,
这时如果想限制指定库的指定目录,就应该指定具体的库,像这样
如果此时你还用[/],则表示所有库的根目录,同理,[/src]表示所有库的根目录下的src目录
使用类似这样的URL:svn://192.168.0.1/project1 即可访问project1
这样的URL:svn://192.168.0.1/project2 即可访问project2
2,对中文目录进行权限控制时,没有将权限文件authz改为utf-8格式。
svn对于非英文文件名和目录名使用utf-8格式编码处理,要对中文目录进行正确控制,
应该使用无BOM的utf-8格式,如何将默认的文件转为utf-8,
我使用的是UltraEdit的菜单"ASCII to UTF-8 (Unicode Editing)"。在UltraEdit的配置中,可以设置有无BOM
更多参考文档:
(配置权限控制文件) http://www.iusesvn.com/bbs/thread-6-1-1.html
(中文目录权限控制) http://www.iusesvn.com/bbs/thread-41-1-1.html
(Apache的单库多库问题) http://www.iusesvn.com/bbs/thread-158-1-1.html
为什么我的客户端没有写权限?
为什么我的权限没有起作用?
总结他们的配置,发现
都是用svnserve作为服务器,
都在svnserve.conf中使用了authz-db选项
原因可能如下:
1,配置authz时,没有注意svnserve启动参数-r所指定的目录。
这里有两种情况:
A:-r直接指定到版本库(称之为单库svnserve方式)
比如,有一个库project1,位于D:/svn/project1
使用以下命令启动svnserve
svnserve -d -r D:/svn/project1
在这种情况下,一个svnserve只能为一个版本库工作
authz文件如果配置成下面这样就是错的,
应该配置成
[groups]
admin=user1
dev=user2
[/]
@admin=rw
@doc=r
admin=user1
dev=user2
[/]
@admin=rw
@doc=r
因为[project1:/]表示库project1的根目录,而按上面的启动参数,是没有库的概念的。
使用类似这样的URL:svn://192.168.0.1/ 即可访问project1
B:-r指定到版本库的上级目录(称之为多库svnserve方式)
同样,有一个库project1,位于D:/svn/project1
如果使用以下命令启动svnserve
svnserve -d -r D:/svn
这种情况,一个svnserve可以为多个版本库工作,
这时如果想限制指定库的指定目录,就应该指定具体的库,像这样
[groups]
admin=user1
dev=user2
[project1:/]
@admin=rw
@doc=r
admin=user1
dev=user2
[project1:/]
@admin=rw
@doc=r
如果此时你还用[/],则表示所有库的根目录,同理,[/src]表示所有库的根目录下的src目录
使用类似这样的URL:svn://192.168.0.1/project1 即可访问project1
这样的URL:svn://192.168.0.1/project2 即可访问project2
2,对中文目录进行权限控制时,没有将权限文件authz改为utf-8格式。
svn对于非英文文件名和目录名使用utf-8格式编码处理,要对中文目录进行正确控制,
应该使用无BOM的utf-8格式,如何将默认的文件转为utf-8,
我使用的是UltraEdit的菜单"ASCII to UTF-8 (Unicode Editing)"。在UltraEdit的配置中,可以设置有无BOM
更多参考文档:
(配置权限控制文件) http://www.iusesvn.com/bbs/thread-6-1-1.html
(中文目录权限控制) http://www.iusesvn.com/bbs/thread-41-1-1.html
(Apache的单库多库问题) http://www.iusesvn.com/bbs/thread-158-1-1.html