在 CentOS 7 上安装 User-Friendly SVN (USVN)

在 Apache HTTP Server 上下载并解压 USVN 应用程序。
我们也可以访问 http://www.usvn.info 获取最新版本。

[root@svnserver01 html]# cd /var/www/html
[root@svnserver01 html]# wget https://github.com/usvn/usvn/archive/1.0.7.tar.gz

创建所需的目录并设置必要的文件夹权限。

[root@svnserver01 html]# mv usvn-1.0.7 usvn
[root@svnserver01 html]# cd usvn
[root@svnserver01 usvn]# mkdir files
[root@svnserver01 usvn]# chmod -R g+w {public,config,files}
[root@svnserver01 usvn]# chgrp -R apache /var/www/html/usvn
[root@svnserver01 usvn]# semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/usvn/config(/.*)?"
[root@svnserver01 usvn]# semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/usvn/files(/.*)?"
[root@svnserver01 usvn]# semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/usvn/public(/.*)?"
[root@svnserver01 usvn]# restorecon -R /var/www/html/usvn

在 Apache HTTP Server 上部署 USVN 应用程序。

[root@svnserver01 usvn]# cat >> /etc/httpd/conf.d/usvn.conf << EOF
> <Directory /var/www/html/usvn/>
>         AllowOverride All
>         Require all granted
> </Directory>
> EOF
[root@svnserver01 usvn]# systemctl restart httpd

在浏览器中打开
http://svnserver01.on-itroad.com/usvn/public/install.php,
开始安装USVN。

单击下一步。

安装程序执行系统检查并产生警告。
如果我们已按照上述确切步骤进行操作,那么我们将不会在此处收到任何警告。

单击下一步。

选择我们需要的语言和时区。

单击下一步。

检查我理解并接受此许可,然后单击下一步。

这里不需要定制。
单击下一步。

提供数据库密码并进行必要的自定义,如我们在上面的屏幕截图中所做的那样。

单击下一步。

在此处创建 USVN 管理员并单击 Next Step。

因为我是在隔离的网络上安装的,所以我更喜欢禁用对更新版本的 USVN 的自动检查。

单击不检查更新。

安装完成。
复制所选代码并将其粘贴到 /etc/httpd/conf.d/usvn.conf 的末尾。

单击连接到 USVN。

使用管理员用户登录。

查看更多教程 https://on  itroad.com

在 CentOS 7 上安装 Apache Subversion (SVN)

USVN 需要一个 Web 服务器来部署。
因此,我们将安装 Apache HTTP Server。

[root@svnserver01 ~]# yum install -y httpd

启动并启用 httpd 服务。

[root@svnserver01 ~]# systemctl start httpd ; systemctl enable httpd
ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.wants/httpd.service'

禁用 Apache HTTP Server 的欢迎页面。

[root@svnserver01 ~]# mv /etc/httpd/conf.d/welcome.conf /etc/httpd/conf.d/welcome.conf.org

在 Apache HTTP Server 配置中禁用目录索引。

[root@svnserver01 ~]# cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.org
[root@svnserver01 ~]# sed -i "s/Options Indexes FollowSymLinks/Options FollowSymLinks/" /etc/httpd/conf/httpd.conf
[root@svnserver01 ~]# systemctl restart httpd

允许 http 服务通过 Linux 防火墙。

[root@svnserver01 ~]# firewall-cmd --permanent --add-service=http ; firewall-cmd --reload
success
success

USVN 需要一个 MySQL 数据库,因为它是后端数据库。
因此,我们还将安装 mariadb 数据库和 php。

[root@svnserver01 ~]# yum install -y php mariadb-server php-mysql

启动并启用 mariadb 服务。

[root@svnserver01 ~]# systemctl start mariadb ; systemctl enable mariadb
ln -s '/usr/lib/systemd/system/mariadb.service' '/etc/systemd/system/multi-user.target.wants/mariadb.service'

配置 mariadb 服务器。

[root@svnserver01 ~]# mysql_secure_installation
/usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] Y
 ... Success!
Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] Y
 ... Success!
By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] Y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] Y
 ... Success!
Cleaning up...
All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!

在 php 设置中设置时区。

[root@svnserver01 ~]# vi /etc/php.ini

在 php.ini 文件中编辑后的屏幕截图如下:

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = Asia/Karachi
; http://php.net/date.default-latitude
;date.default_latitude = 31.7667

安装 Apache Subversion 和相关的 Apache HTTP 服务器模块..

[root@svnserver01 ~]# yum install -y subversion mod_dav_svn

安装环境

  • 主机名 - svnserver01.on-itroad.com
  • IP 地址 - 192.168.1.30/24
  • 网关 - 192.168.1.2
  • DNS 服务器 - 192.168.1.2
  • Yum 存储库 - 本地
  • 操作系统 - Red Hat Enterprise Linux (RHEL)/CentOS 7
在 CentOS 7 上安装 SVN 和 USVN

Apache Subversion(缩写为 SVN)是一个软件版本控制和修订控制系统,在 Apache 许可下作为开源分发。
软件开发人员使用 Subversion 来维护文件的当前和历史版本,例如源代码、网页和文档。
Apache Subversion 随 RHEL、CentOS 等一起提供,可以通过 yum 存储库安装。

User-Friendly SVN (用户友好的 SVN或者 USVN)是一个用 PHP 编写的免费 Web 界面,用于配置 Subversion 存储库。
它的目标是简化新项目的创建,而无需使用命令行界面,也许无需对服务器的特权访问。
然后 USVN 将生成允许访问源代码的用户列表。
这允许授权管理 Subversion 存储库。

在这篇文章中,我们将为 软件开发人员在 Red Hat Enterprise Linux (RHEL)/CentOS 7 上安装和配置中央 SVN 服务器。
软件开发人员不断更新源代码,我们使用 Apache Subversion 来控制修订和版本控制。
我们还将配置 USVN 以方便管理我们的 SVN 服务器。

日期:2020-09-17 00:12:41 来源:oir作者:oir