- 内核版本与系统版本
[root@svn2 ~]# uname -a
Linux svn2 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
[root@svn2 ~]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
- 关闭SeLinux和防火墙
[root@svn2 ~]# vim /etc/selinux/config
SELINUX=disabled
[root@svn2 ~]# systemctl stop firewalld.service
[root@svn2 ~]# systemctl disable firewalld.service
- 配置yum源(这里使用163yum源和epelyum源)
[root@svn2 ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
[root@svn2 ~]# rpm -ivh https://mirrors.ustc.edu.cn/epel/7/x86_64/Packages/e/epel-release-7-14.noarch.rpm
- 编辑配置文件和重新缓存
[root@svn2 ~]# vim /etc/yum.repos.d/CentOS-Base.repo
:%s/$releasever/7/g
[root@svn2 ~]# yum clean all
[root@svn2 ~]# yum makecache
- 安装所需软件
# 这里使用的是mariadb作为数据库
[root@svn2 ~]# yum install subversion httpd mod_dav_svn php php-mysql mariadb-server perl-DBI perl-DBD-mysql mysql-devel mod_auth_mysql
# 重要软件版本如下
[root@svn2 ~]# rpm -qa |egrep "subversion|httpd|mariadb"
mariadb-5.5.68-1.el7.x86_64
mariadb-server-5.5.68-1.el7.x86_64
subversion-libs-1.7.14-16.el7.x86_64
httpd-2.4.6-97.el7.centos.5.x86_64
mariadb-devel-5.5.68-1.el7.x86_64
subversion-1.7.14-16.el7.x86_64
mariadb-libs-5.5.68-1.el7.x86_64
httpd-tools-2.4.6-97.el7.centos.5.x86_64
- 启动httpd和数据库
[root@svn2 ~]# systemctl start httpd.service mariadb.service
[root@svn2 ~]# systemctl enable httpd.service mariadb.service
- 初始化数据库
[root@svn2 ~]# mysql_secure_installation
Set root password? [Y/n] y
New password: 这里输入root管理员密码
Re-enter new password: 重复上一步密码
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y
- 登录数据库测试
[root@svn2 ~]# mysql -uroot -p123456
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 5.5.68-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>
- 下载USVN
[root@svn2 ~]# wget https://github.com/usvn/usvn/archive/1.0.7.tar.gz --no-check-certificate
- 安装配置USVN
[root@svn2 ~]# tar xf 1.0.7.tar.gz
[root@svn2 ~]# mv usvn-1.0.7/ /var/www/html
[root@svn2 ~]# chown -R apache:apache /var/www/html/usvn-1.0.7/
- 配置Apache目录允许重写(默认已经配好)
[root@svn2 ~]# vim /etc/httpd/conf/httpd.conf
# 文件最后加入
<Directory "/var/www/html/">
AllowOverride all
Order allow,deny
Allow from all
</Directory>
13.重启apache服务
[root@svn2 ~]# systemctl restart httpd.service
- 浏览器访问安装
# 用自己的ip
http://192.168.58.179/usvn-1.0.7/public/install.php
-
选择中文和时区
-
创建版本库路径
[root@svn2 ~]# mkdir -p /data/subversion/
[root@svn2 ~]# chown -R apache:apache /data/subversion/
-
配置成版本库路径
-
配置数据库
-
配置管理员信息
-
最后一步将生成的配置,添加到/etc/httpd/conf/httpd.conf文件结尾
-
重启服务 安装完毕
[root@svn2 ~]# systemctl restart httpd.service