CentOS6上安装Subversion

存档备忘

 

1. 安装软件包

 

yum -y install subversion httpd php mysql-server  mod_dav_svn php-mysql php-pear php-mbstring

 

2. 禁用selinux

 

修改/etc/sysconfig/selinux

 

设置SELINUX=disabled

 

重启系统

 

3. 开放防火墙80端口

 

修改/etc/sysconfig/iptables

 

增加行-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

 

重启服务service iptables restart

 

4. 创建文件夹

 

mkdir /home/repos

 

chown -R apache.apache /home/repos

 

5. 修改Apache的配置文件/etc/httpd/conf/httpd.conf

 

 

#LoadModule dav_svn_module modules/mod_dav_svn.so
#LoadModule authz_svn_module modules/mod_authz_svn.so


 ServerName=localhost:80


<Location /repos>
    DAV svn   
    SVNParentPath /home/repos   
    AuthType Basic   
    AuthName "SVN Repository"   
    AuthUserFile /home/repos/.htpasswd   
    AuthzSVNAccessFile /home/repos/svn_access   
    Satisfy Any   
    Require valid-user   
    SetOutputFilter DEFLATE
</Location>
 

6. 安装svnmanager

 

1) 在http://svnmanager.org下载 svnmanager-1.08.tar.gz,展开到/var/www/html下

 

2) 安装VersionControl_SVN

 

pear upgrade-all

pear install -a VersionControl_SVN-0.4.0

 

http://pear.php.net/package/VersionControl_SVN/download

 

3) 创建数据库

 

service mysqld start

mysql

>create database svnmanager character set utf8;

 

4) 修改svnmanager配置文件

 

cd /var/www/html/svnmanager/

 

cp config.php.linux  config.php

 

修改config.php如下内容:

 

 

$svn_config_dir                         =       "/home/repos/svnconfig";
$svn_repos_loc                          =       "/home/repos";
$svn_passwd_file                        =       "/home/repos/.htpasswd";
$svn_access_file                        =       "/home/repos/svn_access";

$smtp_server                    =       "localhost";

$dsn                            =       "mysql://root@localhost/svnmanager";
 

7. 重启Apache

 

apachectl -k restart

 

8. 其他

 

设置httpd自动启动: chkconfig  httpd on

 

设置mysqld 自动启动: chkconfig mysqld on