当前位置: 首页 > 工具软件 > SVNManager > 使用案例 >

centos7搭建svnmanager

廖招
2023-12-01

0. 关闭selinux和防火墙

vim /etc/selinux/config
将SELINUX=enforcing改为SELINUX=disabled
设置后需要重启才能生效

# 关闭防火墙 禁止开机启动
systemctl stop firewalld
systemctl disable firewalld

# 安装常用软件
yum install wget vim -y

1.安装mysql5.7

# 下载源
wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
# 安装源
yum localinstall mysql57-community-release-el7-8.noarch.rpm -y
# 可切换安装源中的版本
vim /etc/yum.repos.d/mysql-community.repo
# 安装mysql57
yum install mysql-community-server -y

# 启动mysql
systemctl start mysqld
# 设置开机启动
systemctl enable mysqld
# 查看状态
systemctl status mysqld

# 查看root的初始密码
vim /var/log/mysqld.log
搜索 temporary password

# 修改密码
set global validate_password_policy=LOW;
set global validate_password_length=4;
alter user 'root'@'localhost' identified by 'root';

# 创建数据库 名为svn
create database svn charset=utf8;

# 退出
quit

2. 安装svn apache


# 安装svn apache
$ yum install subversion httpd -y

#安装svn的httpd扩展模块
$ yum install mod_dav_svn -y

# 安装php和相关扩展
$ yum install php php-pear php-mbstring php-mysqlnd -y
#安装pear库的svn操作扩展
$ pear install VersionControl_SVN-0.3.4

# 设置apache开机启动
systemctl enable httpd

# 创建存放仓库和配置文件的文件夹和文件并授权给apache
mkdir -p /var/svn/repos
mkdir -p /var/svn/conf
mkdir -p /var/svn/trash
touch /var/svn/conf/passwdfile
touch /var/svn/conf/accessfile
chown -R apache:apache /var/svn
# 配置apache
cd /etc/httpd/conf.d
vim subversion.conf

<Location /svn>
   DAV svn
   SVNParentPath /var/svn/repos
   SVNListParentPath On
   AuthType Basic
   AuthName "Authorization DTF SVN"
   AuthUserFile /var/svn/conf/passwdfile
   AuthzSVNAccessFile /var/svn/conf/accessfile
   Require valid-user
</Location>
# 安装svnmanager
wget https://sourceforge.net/projects/svnmanager/files/svnmanager/1.10/svnmanager-1.10.tar.gz

tar zxvf svnmanager-1.10.tar.gz
mv svnmanager-1.10 /var/www/html/svnmanager
# 配置svnmanager
cd /var/www/html/svnmanager
vim config.php
<?php
$lang = "zh_CN.UTF-8";
$htpassword_cmd = "/usr/bin/htpasswd";
$svn_cmd = "/usr/bin/svn";
$svnadmin_cmd = "/usr/bin/svnadmin";
//Subversion locations
$svn_config_dir="/var/svn/conf";
$svn_repos_loc = "/var/svn/repos";
$svn_passwd_file = "/var/svn/conf/passwdfile";
$svn_access_file = "/var/svn/conf/accessfile";
//If the following is set, removing a repository will cause it to be
//moved to this location rather than being deleted.
$svn_trash_loc = "/var/svn/trash";
//$svnserve_user_file = "/var/www/repos/svnserve_passwd_file";
$svnserve_user_file="";
//SMTP Server for outgoing mail
$smtp_server = "smtp.mailserver.net";
$dsn = "mysqli://root:root@localhost/svn";
$admin_name = "admin";
$admin_temp_password = "admin";
?>
# 重启mysql和apache
systemctl restart mysqld
systemctl restart httpd
# 访问url
http://****/svnmanager
# mysql下载过慢解决方案
cd /var/cache/yum/x86_64/7/mysql57-community/packages/
wget http://uni.mirrors.163.com/mysql/Downloads/MySQL-5.7/mysql-community-client-5.7.33-1.el7.x86_64.rpm
wget http://uni.mirrors.163.com/mysql/Downloads/MySQL-5.7/mysql-community-server-5.7.33-1.el7.x86_64.rpm
# 再次安装mysql57
yum install mysql-community-server -y
 类似资料: