想必大家都用过svn吧,一个小团队,用SVN的配置文件还是很轻松的,如果一个大的团队,是不是就觉得麻烦了呢?建立一个项目删除一个项目,添加一个用户删除一个用户,很麻烦还用重读配置文件,SVN图形化控制可以解决麻烦的操作,同样可以简单明了。
实验系统:ubuntu server 7.10
需要软件:svnmanager-1.03.tgz apache2 php5 mysql-server subversion php-mysql php-pear php-cli
1.Subversion安装
apt-get install subversion apache2 php5 php5-cli php-mysql php-pear mysql-server
现在比如我SVN是在 /var/www/svn,那就得创建这个目录,创建后,注意:要更改相关权限
# mkdir -p /var/www/svn
#chown -R www-data.www-data /var/www/svn
现在我要新建一个版本库,名字就叫 repos
#svnadmin create /var/www/svn/repos
#chown -R www-data.www-data /var/www/svn/repos
2.安装SVNManager
将svnmanager-1.03.tgz解压/var/www下目前最新的是 1.03版
#pear install --alldeps VersionControl_SVN-0.3.0alpha1
为SVNManager创建访问用户及数据库:
#mysql –u root –p
Mysql>create database svn;
Mysql>grant all privileges on svn.* to ‘svnmanager’@’localhost’identified by‘password’;
Mysql>flush privileges;
Mysql>quit;
Mysql>create database svn;
Mysql>grant all privileges on svn.* to ‘svnmanager’@’localhost’identified by‘password’;
Mysql>flush privileges;
Mysql>quit;
3.增加权限配置
修改apache2.conf在最后添加
<Location /repos>
DAV svn
SVNParentPath /var/www/svn
AuthType Basic
AuthName "Subversion realm"
AuthUserFile /var/www/svn/passwdfile
AuthzSVNAccessFile /var/www/svn/accessfile
Require valid-user
</Location>
<Directory "/var/www/svnmanager/">
AllowOverride None
Order deny,allow
Deny from all
Allow from all
</Directory>
在/var/www/svn目录下创建两个空文件passwdfile和accessfile。
DAV svn
SVNParentPath /var/www/svn
AuthType Basic
AuthName "Subversion realm"
AuthUserFile /var/www/svn/passwdfile
AuthzSVNAccessFile /var/www/svn/accessfile
Require valid-user
</Location>
<Directory "/var/www/svnmanager/">
AllowOverride None
Order deny,allow
Deny from all
Allow from all
</Directory>
在/var/www/svn目录下创建两个空文件passwdfile和accessfile。
#touch /var/www/svn/passwdfile
#touch /var/www/svn/accessfile
#chown –R www-data.www-data passwdfile
#chown –R www-data.www-data accessfile
#touch /var/www/svn/accessfile
#chown –R www-data.www-data passwdfile
#chown –R www-data.www-data accessfile
4.配置svnmanager
#cd /var/www/svnmanager
#cd /var/www/svnmanager
mv config.php.linux config.php
<?php
$htpassword_cmd = "/usr/bin/htpasswd";
$svn_cmd = "/usr/bin/svn";
$svnadmin_cmd = "/usr/bin/svnadmin";
$svn_cmd = "/usr/bin/svn";
$svnadmin_cmd = "/usr/bin/svnadmin";
//Subversion locations
$svn_repos_loc = "/var/www/svn/repos";
$svn_passwd_file = "/var/www/svn/passwdfile";
$svn_access_file = "/var/www/svn/accessfile";
$svn_trash_loc = "";
$svnserve_user_file="";
$smtp_server = "smtp.mailserver.net";
$dsn = "mysqli://svnmanager:password@localhost/svn";
$svn_repos_loc = "/var/www/svn/repos";
$svn_passwd_file = "/var/www/svn/passwdfile";
$svn_access_file = "/var/www/svn/accessfile";
$svn_trash_loc = "";
$svnserve_user_file="";
$smtp_server = "smtp.mailserver.net";
$dsn = "mysqli://svnmanager:password@localhost/svn";
$admin_name = "admin";
$admin_temp_password = "admin";
?>
启动apache2.mysql
$admin_temp_password = "admin";
?>
启动apache2.mysql
会自动建svn的数据表,在刷新后输入用户名为admin,密码为admin.
记得进入用建立一个管理员帐号,因为admin一次后失效。
如图:
本文转自Deidara 51CTO博客,原文链接:http://blog.51cto.com/deidara/89906,如需转载请自行联系原作者