Linux本文以CentOS 5和REDHAT 5为安装环境。别的环境请各位测试.svn的功能如下介绍。
SVNManager
is a web based tool to administer a Unix/Linux Apache WebDAV Subversion
repository server.
With
SVNManager
, you can remotely:
- create, remove, load and dump repositories
- Manage user accounts for access to the repositories
- Manage groups for acces to the repositories
- Invite users by email to create an account on the server
Requirements:
1.Subversion部署
首先安装Subversion,我非常不建议使用编译安装,为了那么一点点小的性能,搞那么麻烦,以后编译和升级还麻烦.
下面我们使用yum安装,如果你的yum慢,你看我的另外的有关yum的文章
#yum install subversion mod_dav_svn php-mysql php-pear
httpd
我的svn是1.42和dav和http集成要用到.
现在比如我的svn是在/var/svn,那就得创建这个目录.创建后,注意:要更改相关的权限
#mkdir -p /var/svn/repos
#chown –R apache:apache /var/svn/
现在我新建一个叫x99repos的版本库
创建版本库:
#svnadmin create /var/svn/repos/x99repos
#chown –R apache.apache /var/svn/repos/x99repos
2.安装SVNManager
准备SVNManager源代码包(svnmanager-1.03.tgz):
下载地址:
http://jaist.dl.sourceforge.net/sourceforge/svnmanager/svnmanager-1.03.tgz
将文件解压至/var/www/html下:
#tar –xvzf svnmanager-1.03.tgz
#mv svnmanager-1.03 /var/www/html/svnmanager
目前最新的是1.03.日期是10.9更新的
3.安装SVNManager
SVNManager需要通过php-pear安装一个叫VersionControl_SVN的.将机器连接上互联网哦
#pear install --alldeps VersionControl_SVN-0.3.0alpha1
4.为SVNManager创建访问用户及数据库:
#mysql –u root –p
Mysql>create database svn;
Mysql>grant all privileges on svn.* to
[email=%E2%80%98svnmanager%E2%80%99@%E2%80%99localhost%E2%80%99]‘svnmanager’@’localhost’[/email]
identified by ‘[访问用户密码]’;
Mysql>flush prifileges;
Mysql>quit;
5.增加权限配置
修改为配置的内容/etc/httpd/conf/httpd.conf加入以下:
DAV svn
SVNParentPath /var/svn/repos
AuthType Basic
AuthName "Subversion realm"
AuthUserFile /var/svn/passwdfile
AuthzSVNAccessFile /var/svn/accessfile
Require valid-user
http权限控制增加如下内容,以加强安全控制
AllowOverride None
Order deny,allow
Deny from all
Allow from all
在/var/svn目录下创建两个空文件passwdfile和accessfile。并执行下边的语句:
#touch /var/svn/passwdfile
#touch /var/svn/accessfile
#chown –R apache.apache passwdfile
#chown –R apache.apache accessfile
6.配置svnmanager
在/var/www/html/svnmanager/config.php文件中,配置相关信息,如下
$htpassword_cmd = "/usr/bin/htpasswd";
$svn_cmd = "/usr/bin/svn";
$svnadmin_cmd = "/usr/bin/svnadmin";
$svn_repos_loc = "/var/svn/repos";
$svn_passwd_file = "/var/svn/passwdfile";
$svn_access_file = "/var/svn/accessfile";
$smtp_server = "smtp.domain.org";
$dsn = "mysql://svnmanager:[password]@localhost/svn";
//Administrator account
$admin_name = "admin";
$admin_temp_password = "admin";
启动Apache、Mysql
打开 http://127.0.0.1/svnmanager
,会自动建svn的数据表,在刷新后输入用户名称为admin,密码为admin.
记的进入用建一个管理员帐号,因为admin一次后失效。
完了,如图: |