SVNManager配置

1、svn与apache的安装
yum install -y subversion httpd
 
httpd.conf添加如下内容:
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
<VirtualHost *:81>
    ServerAdmin root@localhost
    DocumentRoot /var/www/html/
    ServerName svn-whyd.mysoft.com.cn
    ErrorLog logs/svn-whyd-error_log
    CustomLog logs/svn-whyd-access_log common
    <Directory "/var/www/html/svnmanager/">
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from all
    </Directory>
    <Location /svn/>
        DAV svn
        SVNListParentPath on
        SVNParentPath /webser/svn/repos
        AuthType Basic
        AuthName "Mysoft SVN"
        AuthUserFile /webser/svn/repos/passwdfile
        AuthzSVNAccessFile /webser/svn/repos/accessfile
        Require valid-user
    </Location>
</VirtualHost>

创建如下几个目录与文件:

mkdir /webser/svn/{repos,svn,svnconfig}
touch /webser/svn/repos{passwdfile,accessfile}
chown apache.apache /webser/svn -R
 
2、安装与配置svnmanager
将下载的svnmanger解压至/var/www/html/目录下,并重命名为svnmanager
通过php的pear安装VersionControl_SVN,最新版本为0.5.2,但好像此版本有些不兼容,建议安装0.3.3,如下:
pear install --alldeps VersionControl_SVN-0.3.3

 

3、配置svnmanger使用的数据库

mysql> create database svnmanger;
mysql> grant all on svnmanger.* to svnmanger@localhost identified by 'svnmanger';
mysql> flush privileges;

 

4、svnmanger的配置文件config.php如下:

<?php
$lang     = "en_US.UTF-8";
$htpassword_cmd      =     "/usr/bin/htpasswd";
$svn_cmd      =     "/usr/bin/svn";
$svnadmin_cmd      =     "/usr/bin/svnadmin";
$svn_config_dir     =    "/webser/svn/svnconfig";
$svn_repos_loc      =     "/webser/svn/repos";
$svn_passwd_file      =     "/webser/svn/repos/passwdfile";
$svn_access_file      =     "/webser/svn/repos/accessfile";
$svn_trash_loc     =    "";
$svnserve_user_file="";
$smtp_server      =     "smtp.mailserver.net";
$dsn     =     "mysqli://svnmanager:svnmanager@localhost/svnmanager";
$admin_name     =    "admin";
$admin_temp_password     =    "admin";
?>

 

5、访问方法:
默认用户和密码都为admin,创建新用户后,admin用户失效
 
6、安装过程中遇到的错误:
Repository administration->User/Gropu Privileges->任意一个select
错误信息:
[2] UserPrivilegesEditPage::require_once(VersionControl/SVN.php) [userprivilegeseditpage.require-once]: 
failed to open stream: No such file or directory (@line 201 in file C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\svnmanager\svnmanager\RepositoryModule\UserPrivilegesEditPage.php).
Debug Backtrace
#1 UserPrivilegesEditPage.php:201 -- pradoErrorHandler(...)
#2 UserPrivilegesEditPage.php:201 -- UserPrivilegesEditPage::onLoad()
#3 TControl.php:419 -- UserPrivilegesEditPage->onLoad(...)
#4 TPage.php:1079 -- TControl->onLoadRecursive(...)
#5 TPage.php:955 -- TPage->onLoadRecursive(...)
#6 TApplication.php:483 -- TPage->execute()
#7 index.php:5 -- TApplication->run() 

因为VersionControl_SVN安装的是最新的0.5.2版本,降到0.3.3版本即可

posted @ 2015-07-27 10:46  breezey  阅读(2165)  评论(0编辑  收藏  举报