本文主要介绍如何在CentOS7环境下集成Apache和SVN,完成后可以通过浏览器访问SVN仓库.

1.查看系统环境,关闭防火墙和SELinux.

 [root@Docker /]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld()
[root@Docker /]# getenforce
Disabled
[root@Docker /]# uname -a
Linux Docker 3.10.-693.21..el7.x86_64 # SMP Wed Mar :: UTC x86_64 x86_64 x86_64 GNU/Linux
[root@Docker /]# cat /etc/redhat-release
CentOS Linux release 7.4. (Core)
[root@Docker /]#

2.安装软件包和Apache SVN模块.

  yum install httpd mod_dav_svn subversion

3. 验证安装结果.

 [root@Docker /]# httpd -version
Server version: Apache/2.4. (CentOS)
Server built: Apr ::
[root@Docker /]# svnserve --version
svnserve, version 1.7. (r1542130)
compiled Apr , ::

4.验证Apache SVN模块是否安装成功,需要检查mod_dav_svn.so和mod_authz_svn.so文件.

 [root@Docker modules]# pwd
/etc/httpd/modules
[root@Docker modules]# ll | egrep "mod_dav_svn.so|mod_authz_svn.so"
-rwxr-xr-x root root Apr : mod_authz_svn.so
-rwxr-xr-x root root Apr : mod_dav_svn.so

5.使用svnadmin命令创建SVN仓库repos.

 [root@Docker /]# mkdir /var/www/svn
[root@Docker /]# cd /var/www/svn/
[root@Docker svn]# svnadmin create repos
[root@Docker svn]# tree -d repos/
repos/
├── conf
├── db
│   ├── revprops
│   │   └──
│   ├── revs
│   │   └──
│   ├── transactions
│   └── txn-protorevs
├── hooks
└── locks directories

6.修改repos目录属主和属组为apache.

 [root@Docker svn]# chown -R apache:apache repos/
[root@Docker svn]# ll
total
drwxr-xr-x apache apache May : repos

7.复制/var/www/svn/repos/conf 下的权限管理文件authz到 /var/www/svn下,并创建用户认证文件passwd,并且设置隐藏属性.

 [root@Docker svn]# cp /var/www/svn/repos/conf/authz /var/www/svn/
[root@Docker svn]# cd /var/www/svn/repos
[root@Docker repos]# touch .passwd

8.通过htpasswd命令建立SVN用户svnuser并将用户信息保存在passwd文件中.

 [root@Docker repos]# htpasswd ./.passwd svnuser
New password:
Re-type new password:
Adding password for user svnuser
[root@Docker repos]# cat .passwd
svnuser:$apr1$ThE7aO2O$CQo.OIs.8TOqUFaFr7b3H0

9.修改authz文件并设置相应权限:

在[groups]下添加组

[/] 相当于/var/www/svn这个目录,赋予权限给用户组

[repos:/] 是指repos库

[repos:/desgin]是repos下的desgin目录

rw是指可读写权限

 [root@Docker svn]# vim authz
[root@Docker svn]# grep -v "^#" authz [groups]
admin_group=svnuser,svnuser2
project_group=svnuser3,svnuser4
project2_group=svnuser5,svnuser6 [/]
@admin_group=rw [repos:/]
@project_group=rw [repos:/desgin]
@project_group=rw [repos2:/]
@project2_group=rw

10.关联Apache与SVN,创建subversion.conf文件.Locaion后的名字可以自定义,不需要与仓库名一致,这里我们定义为/documents,这样后面访问时直接输入http://x.x.x.x/documents即可打开仓库

[root@Docker /]# vim /etc/httpd/conf.d/subversion.conf

LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so <Location /documents>
DAV svn
SVNParentPath /var/www/svn
SVNListParentPath On
AuthType Basic
AuthName "Project SVN"
AuthUserFile /var/www/svn/repos/.passwd
Require valid-user
AuthzSVNAccessFile /var/www/svn/authz
</Location>

11.启动Apache,在浏览器中输入http://x.x.x.x/documents弹出认证窗口,输入用户认证信息即可看到SVN仓库repos.

 [root@Docker /]# systemctl start httpd.service

CentOS7集成Apache和SVN的更多相关文章

  1. Apache Project SVN Download Sit

    apache project svn download sit : http://svn.apache.org/repos/asf 如果想要研究相关项目的源码的话.或者想要成为某个项目的开发者, 就可 ...

  2. linux上nginx+apache 搭建 svn服务器

    众所周知,nginx目前是不支持svn的,并且由于机房网络只开了80和22(ssh)端口,所以这时候就没法单独在服务器上搭建apache+svn .所以就产生了 nginx + apache + sv ...

  3. Apache 下SVN项目管理使用说明

    Apache 下SVN项目管理使用说明 (1)Apaceh和SVN先要装好. (2)在apache的目录下找到httpd.conf文件,在最后一行增加如下配置 Include conf/svn.pro ...

  4. 基于腾讯Centos7云服务器搭建SVN版本控制库

    基于腾讯Centos7云服务器搭建SVN版本控制库 最近在和小伙伴组队参加一个关于人工智能的比赛,无奈不知道怎么处理好每个人的代码托管问题,于是找到了晚上免费svn托管服务器的服务,但是所给的免费空间 ...

  5. Linux整合Apache和SVN

    1.安装APR-1.2.7和APR-util-1.2.7  (下载地址:http://apr.apache.org/) #tar zxvf  apr-1.2.7.tar.gz #cd   apr-1. ...

  6. 在Linux(CentOS 6.6)服务器上安装并配置基于Apache的SVN服务器

    #!/bin/bash # # 在Linux(CentOS 6.6)服务器上安装并配置基于Apache的SVN服务器: # # .安装服务 # .创建svn版本库 # .创建svn用户 # .配置sv ...

  7. CentOS7安装 Apache HTTP 服务器

    CentOS7安装 Apache HTTP 服务器 时间:2015-05-02 00:45来源:linux.cn 作者:linux.cn 举报 点击:11457次 不管你因为什么原因使用服务器,大部分 ...

  8. centos7.3给搭建SVN服务器

    centos7.3给搭建SVN服务器 1 安装svnserver yum install subversion 2 查看版本 svnserve --version 3 创建版本库 3.1 运行以下命令 ...

  9. centos7安装apache http server启动失败--Failed to start The Apache HTTP Server.

    centos7安装apache http server启动失败     除了nginx可以开启http服务外,apche http server也可以开启http服务,安装过程如下:1. 首先,检测是 ...

随机推荐

  1. maven(12),排除冲突JAR包

     JAR包冲突 <dependencies> <dependency> <groupId>org.springframework</groupId> ...

  2. Jmeter————监控服务器性能

    1. 下载jmeter插件 上面2个是jmeter插件,第3个要放在监控的服务器中. 2. 解压压缩包 找到解压包中的JAR文件,并拷贝到jmeter的lib/ext目录下,这里下载的1.4版本的插件 ...

  3. SpringMVC与shiro集成及配置文件说明!

    在项目中xml文件的配置是必不可少的,特别是SpringMVC框架.但是几乎所有项目的配置都是大同小异,很多人都是直接复制黏贴了事,不少人对其具体含义及用途都不甚全知.本片文章将正对项目中常用的框架S ...

  4. python之路——网络基础

    你现在已经学会了写python代码,假如你写了两个python文件a.py和b.py,分别去运行,你就会发现,这两个python的文件分别运行的很好.但是如果这两个程序之间想要传递一个数据,你要怎么做 ...

  5. php自动载方法有两种.

    但有一问题没有解决, 就是在include前判断文件是否存在的问题. 1 2 3 4 5 6 7 8 9 10 11 12 13 set_include_path('aa' . PATH_SEPARA ...

  6. December 06th 2016 Week 50th Tuesday

    Behind every beautiful thing, there is some kind of pain. 美丽背后,必有努力. No pains, no gains. But it seem ...

  7. December 21st 2016 Week 52nd Wednesday

    Keep conscience clear, then never fear. 问心无愧,永不畏惧. I find it is very difficult for me to keep consci ...

  8. 内存池-转载自IBM

    [转载自IBM]讲的很好~推荐看看 6.1 自定义内存池性能优化的原理 如前所述,读者已经了解到"堆"和"栈"的区别.而在编程实践中,不可避免地要大量用到堆上的 ...

  9. 真实世界中的 Swift 性能优化

    那么有什么因素会导致代码运行缓慢呢?当您在编写代码并选择架构的时候,深刻认识到这些架构所带来的影响是非常重要的.我将首先谈一谈:如何理解内联.动态调度与静态调度之间的权衡,以及相关结构是如何分配内存的 ...

  10. visual stdio 安装OpenGL库文件

    1.将下载的压缩包解开.将得到5个文件 1. 将glut解压出来,将当中的glut.h拷贝到C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC ...