1、环境安装
其他使用yum下载:yum install subversion httpd php mod_dav_svn php-pear php-mbstring
下载:iF.SVNAdmin 下载地址:http://svnadmin.insanefactory.com/
2、集成SVN与Apache
2.1修改配置文件/etc/httpd/conf.d/subversion.conf
内容:
<Location /svn>
DAV svn
SVNParentPath /var/www/svn
AuthType Basic
AuthName "Restricted Access"
#File will be created by SVNManager, keep location in mind!
AuthUserFile /var/www/svnconfig/passwdfile
Require valid-user
#SSLRequireSSL
#File will be created by SVNManager, keep location in mind
AuthzSVNAccessFile /var/www/svnconfig/accessfile
# Limit write permission to list of valid users.
#
# # Require SSL connection for password protection.
# # SSLRequireSSL
# AuthType Basic
# AuthName "Authorization Realm"
# AuthUserFile /path/to/passwdfile
# Require valid-user
#
</Location>
2.2 创建存放的仓库和存放权限信息的目录
mkdir -p /var/www/svn /var/www/svnconfig
chmod -R 777 /var/www/svn
chown -R apache:apache /var/www/svn
chmod -R 777 /var/www/svnconfig
chown -R apache:apache /var/www/svnconfig/
2.3创建svn权限信息文件
touch /var/www/svnconfig/accessfile /var/www/svnconfig/passwdfile
chmod -R 777 /var/www/svnconfig/accessfile
chown -R apache:apache /var/www/svnconfig/accessfile
chmod -R 777 /var/www/svnconfig/passwdfile
chown -R apache:apache /var/www/svnconfig/passwdfile
2.4将if.svnadmin的目录包 放到/var/www/html中
我的if.svnadmin在/opt中
cp -r if.svnadmin /var/www/html/svnadmin
chmod -R 777 /var/www/html/svnadmin/data/
chown -R apache:apache /var/www/html/svnadmin/
2.5启动httpd服务
service httpd start
3、svnadmin配置
输入:http://ip/svnadmin,首先需要进行配置,如图中的Test按钮可以对相关的配置进行校验
输入完成后点击Save configuration。提示默认账户admin/admin
点击Repositories并选择Add,创建一个repo
输入需要创建的repo名称,其他默认即可,然后点击Create,创建完成repo后,点击Access-Paths添加权限
通过http://servername/svn/reponame,使用admin账户进入刚刚建立完成的repo