一. Subversion 简介 
Subversion是一个自由,开源的版本控制系统。在Subversion管理下,文件和目录可以超越时空。Subversion将文件存放在中心版本库里。这个版本库很像一个普通的文件服务器,不同的是,它可以记录每一次文件和目录的修改情况。这样就可以籍此将数据恢复到以前的版本,并可以查看数据的更改细节。正因为如此,许多人将版本控制系统当作一种神奇的“时间机器”。 
二. 环境准备 
用1台centos 6.5。 

[[email protected] ~]# vim /etc/selinux/config    

Subversion + Usvn 搭建版本管理服务器

设置SELINUX=disabledt重启后关闭selinux 。

[[email protected]  ~]# setenforce 0
setenforce: SELinux is disabled

查看是否关闭了selinux。

 

三、安装

1. 安装所需软件 
[[email protected] ~]# yum install subversion httpd mod_dav_svn php php-mysql mysql-server perl-DBI perl-DBD-mysql mysql-devel mod_auth_mysql 

Subversion + Usvn 搭建版本管理服务器

查看 subversion 是否安装成功,如下图:

Subversion + Usvn 搭建版本管理服务器

2.启动httpd、mysqld服务

[[email protected] ~]# service httpd start
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using yxp2p.server for ServerName
[ OK ]
[[email protected] ~]# service mysqld start
Starting mysqld: [ OK ]

 

启动后设置mysqld密码,后面安装usvn时需要用

[[email protected] ~]# mysqladmin -u root password 123123

 

3. 配置开机启动 

Subversion + Usvn 搭建版本管理服务器

[[email protected] ~]# chkconfig svnserve on  设置svn服务随机启动。

 

四.配置Usvn

[[email protected] ~]# wget https://github.com/usvn/usvn/archive/1.0.7.tar.gz

[[email protected] ~]# tar zxvf 1.0.7 

[[email protected] ~]# mv usvn-1.0.7/ /home/webroot/usvn  

[[email protected] ~]# chown -R apache:apache /home/webroot/usvn 

[[email protected] ~]# vim  /etc/httpd/conf/httpd.conf 

Alias /usvn "/home/webroot/usvn/public"   
<Directory "/home/webroot/usvn/public">     

  Options +SymLinksIfOwnerMatch     

  AllowOverride All     

  Order allow,deny     

  Allow from all 

</Directory>

配置完后重启httpd 
[[email protected] ~]# service httpd restart 
通过IE打开http://172.16.11.89/usvn/就可以按步骤一步步完成,此时如果打不开,请检查你的iptables、selinux是否有限制。

 

Subversion + Usvn 搭建版本管理服务器

出现上面的提示,尝试关闭SElinux看能否解决。

 

Subversion + Usvn 搭建版本管理服务器

 

访问正常将会出现下面界面。

 Subversion + Usvn 搭建版本管理服务器

第四步如果使用默认值不行,请做调整

Subversion + Usvn 搭建版本管理服务器

 

 
改为以下路径则可以顺利进入下一步

 

我本地的的仓库地址是 /home/subversion, 注意设置目录权限

[[email protected] ~]# mkdir -p /home/subversion

[[email protected] ~]# chown -R apache:apache /home/subversion

 

Subversion + Usvn 搭建版本管理服务器

 

 
改为以下路径则可以顺利进入下一步 
填入上面创建的mysqld用户名和密码,勾选“创建数据库”,此处如果你没有安装php-pdo则会报错

Subversion + Usvn 搭建版本管理服务器

 

创建一个账号用于登陆管理usvn

 

Subversion + Usvn 搭建版本管理服务器

 

Subversion + Usvn 搭建版本管理服务器

 

复制下面的代码到/etc/httpd/conf/httpd.conf里

Subversion + Usvn 搭建版本管理服务器

 

[[email protected] usvn]# vim /etc/httpd/conf/httpd.conf

Subversion + Usvn 搭建版本管理服务器

 

点上面的“连接到USVN”登陆

Subversion + Usvn 搭建版本管理服务器

 

至此整个subversion及USVN搭建完成。需要用USVN测试创建用户、用户组、项目是否正常。

相关文章:

  • 2021-04-03
  • 2021-07-06
  • 2022-01-06
  • 2021-10-12
猜你喜欢
  • 2021-05-21
  • 2021-08-30
  • 2021-08-18
  • 2021-12-21
  • 2022-12-23
  • 2021-11-05
  • 2021-11-05
相关资源
相似解决方案