172173.com

官网:http://svnmanager.sourceforge.net/

软件版本

1
2
3
4
5
6
7
操作系统:CentOS7.6
Subversion:1.8.19
Apache:httpd-2.4.6
MySQL:5.7.24
PHP:5.4
svnmanager:1.10
VersionControl_SVN:0.3.4

一、安装php

1.安装php及模块

1
yum install -y php php-mysql php-pear php-mbstring
  • 配置php.ini
1
2
# 配置时区
date.timezone = "Asia/Shanghai"

2.配置apache + php

参考文档《Apache和PHP结合》https://blog.csdn.net/aoli_shuai/article/details/78847700

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
[[email protected] conf]# cat httpd.conf
ServerRoot "/etc/httpd"
Listen 80
Include conf.modules.d/*.conf
User apache
Group apache
ServerAdmin [email protected]
ServerName svn.test.com:80 # 改这里:配置一个域名
<Directory />
AllowOverride none
Require all granted # 改这里:允许访问根目录
</Directory>
DocumentRoot "/data/wwwroot/svn.test.com" # 改这里:根目录
<Directory "/var/www">
AllowOverride None
Require all granted
</Directory>
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<IfModule dir_module>
DirectoryIndex index.html index.php # 改这里:增加index.php
</IfModule>
<Files ".ht*">
Require all denied
</Files>
ErrorLog "logs/error_log"
LogLevel warn
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
CustomLog "logs/access_log" combined
</IfModule>
<IfModule alias_module>
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
</IfModule>
<Directory "/var/www/cgi-bin">
AllowOverride None
Options None
Require all granted
</Directory>
<IfModule mime_module>
TypesConfig /etc/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php # 改这里:apache调用php
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
</IfModule>
AddDefaultCharset UTF-8
<IfModule mime_magic_module>
MIMEMagicFile conf/magic
</IfModule>
EnableSendfile on

3.查看apache加载php模块

1
2
[[email protected] conf]# apachectl -M|grep php
php5_module (shared)

4.phpinfo.php测试访问

1
2
3
4
5
[[email protected] conf]# cat /data/wwwroot/192.168.99.207/phpinfo.php 
<?php
phpinfo();
?>
[root

image

二、安装MySQL

1.安装(略)

2.配置MySQL

1
2
3
4
create database svnmanager;
create user 'svnmanager'@'localhost' identified by 'svnmanager';
grant all privileges on svnmanager.* to 'svnmanager'@'localhost';
flush privileges;

三、安装svnmanager

1.下载svnmanager

1
2
3
4
5
6
7
8
9
10
11
## 部svnmanager-1.10
cd /usr/local/src/
wget http://prdownloads.sourceforge.net/svnmanager/svnmanager-1.10.zip
unzip svnmanager-1.10.zip
mv svnmanager-1.10 /data/wwwroot/192.168.99.207/svnmanager

## 部署VersionControl_SVN-0.3.4.tgz
wget http://download.tdtech.gao7.com/linux/tools/tarball/VersionControl_SVN-0.3.4.tgz
tar xvf VersionControl_SVN-0.3.4.tgz -C /data/wwwroot/192.168.99.207/svnmanager/
cd /data/wwwroot/192.168.99.207/svnmanager/
mv VersionControl_SVN-0.3.4 VersionControl

2.配置config.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
cd /data/wwwroot/192.168.99.207/svnmanager/
cp config.php.linux config.php
>config.php
cat 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 = "/data/svn/svn_pass";
$svn_repos_loc = "/data/svn/svn_data";
$svn_passwd_file = "/data/svn/svn_pass/http_users";
$svn_access_file = "/data/svn/svn_pass/auth";
$svn_trash_loc = "/data/svn/svn_trash";
$svnserve_user_file = "";
$smtp_server = "smtp.mailserver.net";
$dsn = "mysqli://svnmanager:[email protected]/svnmanager";
$admin_name = "admin";
$admin_temp_password = "admin";
?>

3.授权站点目录

1
2
cd /data/
chown -R apache.apache wwwroot

四、访问svnmanager

1.访问测试

1
http://192.168.99.207/svnmanager/

找不到mysql sock文件

image

2.配置MySQL socket软链接

1
2
mkdir -p /var/lib/mysql/
ln -s /data/mysql_data_3306/mysql_3306.sock /var/lib/mysql/mysql.sock

3.再次访问测试

image

4.登陆

初始账号:admin:admin

image

5.首次登陆配置

  • 第一次用admin登陆无法创建仓库,需要再创建过另一个管理员账户,而后admin的账户被废弃
  • 创建一个administartor:123456的超级管理员账户,而后用该账户配置用户与仓库即可。

image

 评论