找回密码
 立即注册
搜索
查看: 379|回复: 0

iF.SVNAdmin 安装和使用笔记

[复制链接]

266

主题

0

回帖

1119

积分

管理员

积分
1119
发表于 2024-2-16 11:57:39 | 显示全部楼层 |阅读模式

iF.SVNAdmin 是一个基于 Web 的 GUI(图形用户界面)工具,用于管理 Subversion 的库和授权文件。

安装 Apache:

yum -y install mod_dav_svn #apache svn支持模块

安装 PHP:

yum -y install php

安装 Subversion

yum -y install subversion
svnserve --version #查看版本信息,测试安装是否成功

安装 iF.SVNAdmin:

wget https://github.com/mfreiholz/iF.SVNAdmin/archive/stable-1.6.2.tar.gz
tar -zxf stable-1.6.2.tar.gz
mv iF.SVNAdmin-stable-1.6.2/ /data/svnadmin/
chown -R apache:apache /data/svnadmin/

在 /etc/httpd/conf.d/ 创建一个虚拟服务器配置:svnadmin-vhost.conf

Listen 888

<VirtualHost 192.168.72.100:888>
  ServerAdmin name@email.com
  ServerName 192.168.72.100

  ErrorLog /etc/httpd/logs/svnadmin-error_log
  TransferLog /etc/httpd/logs/svnadmin-access_log
 
  SSLEngine on
  SSLCertificateFile /data/ssl/localhost.crt
  SSLCertificateKeyFile /data/ssl/localhost.key

  DocumentRoot /data/svnadmin
  <Directory "/data/svnadmin">
    Options FollowSymLinks
    AllowOverride all
    Require all granted
  </Directory>

  Alias /svn /var/www/svn1
  <Location /svn> 
    DAV svn
    SVNParentPath /data/svn1
    AuthzSVNAccessFile /data/svn1/authz
    AuthUserFile /data/svn1/htpasswd 
    AuthName "Subversion Repositories"
    AuthType Basic
    Require valid-user
  </Location>
</VirtualHost>

创建服务目录:

mkdir /data/svn1
touch /data/svn1/authz
touch /data/svn1/htpasswd
chown -R apache:apache /data/svn1

禁用 SELinux:

setenforce 0 #临时关闭
vim /etc/selinux/config
将SELINUX=enforcing改为SELINUX=disabled #需要重启

配置防火墙:

firewall-cmd --permanent --add-port=888/tcp
systemctl restart firewalld
systemctl restart httpd.service

打开网页 https://192.168.72.100:888,跳转到初始化配置页面,配置如下

Subversion authorization file: /data/svn1/authz
User view provider type: passwd
User edit provider type: passwd
Group view provider type: svnauthfile
Group edit provider type: svnauthfile
Repository view provider type: svnclient
Repository edit provider type: svnclient
User authentication file (SVNUserFile): /data/svn1/htpasswd
Parent directory of the repositories (SVNParentPath): /data/svn1
Subversion client executable: /usr/bin/svn
Subversion admin executable: /usr/bin/svnadmin

保存配置,提示自动生成管理员账户和密码:User: admin ,Password: admin

编辑配置文件:

vim /data/svnadmin/data/config.ini
在[GUI]下增加一行:
ApacheDirectoryListing=https://192.168.72.100:888/svn/%1/%2

源码修改记录:

function xml_svn_list_character_data($xml_parser, $tagdata) 中的 $this->curList->curEntry->name.= self::encode_string(trim($tagdata));   trim函数会使 “01 测试”类似的字符与汉字间的空格也被清掉,临时换用ltrim来解决这个问题。
改为:
$this->curList->curEntry->name.= self::encode_string(ltrim($tagdata));

中文库名的支持:

从 1.7 版本开始使用 Apache + SVN,虽然在默认的情况下,mod_dav_svn 支持库内出现非纯英文命名的文件夹或文件名,但是一直不支持库名中出现非纯英文的字符。

试了很多方法都不能解决,偶然间了解到 mod_dav_svn 使用 7 位的 ASCII 编码与其钩子脚本交互,所以对于 UTF-8 等多字节的编码是不支持的,所以总会出现 Internal error: Can't convert string from 'UTF-8' to native encoding,即使库名已经使用了 UTF-8 编码也不行。

从 1.8 版本开始支持 SVNUseUTF8 On|Off 配置,在 httpd.conf 中添加一行:

SVNUseUTF8 On

就可以支持中文的库名了。


您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|棱讯科技 ( 粤ICP备2024228160号-2|粤公网安备44030002003510号 )

GMT+8, 2024-7-27 18:12 , Processed in 0.016308 second(s), 3 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表