centos7+apache+svn配置 踩坑,注意权限问题。apache应用目录checkout应用 必须用这个命令:svn co file:///home/svn/test/ test ,通过svn add * &&commit 及任意修改都是不行的
- 阅读帮助
命令提示符
[root@server-002 ~]#
表示当前服务root用户执行的命令
[svn@server-002 ~]$
表示普通用户svn执行的命令
[root@localhost ~]#
表示其它服务器的root用户
系统配置
CPU: 2核
内存: 8G
硬盘: 1T
服务器OS: CentOS7
服务器IP: 192.168.1.2
服务简介
SVN 版本库 server
服务管理
管理用户 | 命令 | 说明 |
---|---|---|
svn | sudo systemctl start httpd | 启动服务 |
svn | sudo systemctl stop httpd | 停止服务 |
root | systemctl start httpd | 启动服务 |
root | systemctl stop httpd | 启动服务 |
服务安装和配置
安装SVN服务
- 创建svn用户
[root@server-002 ~]# useradd svn
[root@server-002 ~]# passwd svn - 查看是否已经安装svn
[root@server-002 ~]# rpm -qa subversion - 如果没有,直接第4步,如果有,先卸载
[root@server-002 ~]# rpm remove subversion -y - 创建svn.repo文件
[root@server-002 ~]# vi /etc/yum.repos.d/svn.repo
[SVN]
name=SVN Repo
baseurl=http://opensource.wandisco.com/centos/7/svn-1.9/RPMS/$basearch/
enabled=1
gpgcheck=0
- 1
- 2
- 3
- 4
- 5
- 执行yum安装svn
[root@server-002 ~]# yum install subversion -y
- 防火墙打开svn默认的3690端口
[root@server-002 ~]# firewall-cmd –zone=public –add-port=3690/tcp –permanent
[root@server-002 ~]# firewall-cmd –reload
迁移SVN数据
- ssh到原SVN服务器备份旧SVN数据仓库
[root@localhost ~]# svnadmin dump /var/www/svn/latRepo > /svndump/latRepo.dump
- 将备份copy到新的SVN服务器
[root@localhost ~]# scp /svndump/*.dump svn@192.168.1.2:~/dump - 回到新的SVN服务器,登陆svn用户,创建版本库
[svn@server-002 ~]$ svnadmin create latRepo - 恢复版本库
[svn@server-002 ~]$ svnadmin load latRepo < dump/latRepo.dump - 创建日志目录
/home/svn/logs
[svn@server-002 ~]$ mkdir logs - 创建配置目录
/home/svn/conf
[svn@server-002 ~]$ mkdir conf - 创建配置文件
/home/svn/conf/svnserve.conf
(示例)
[svn@server-002 ~]$ vim conf/svnserve.conf
[general]
anon-access = read
auth-access = write
password-db = passwd
authz-db = authz
[sasl]
- 1
- 2
- 3
- 4
- 5
- 6
- 创建用户文件
/home/svn/conf/passwd
(示例)[svn@server-002 ~]$ vim conf/passwd.conf
[users]
hezhigang=hezhigang
shenfu=shenfu
yangshuaifei=yangshuaifei
- 1
- 2
- 3
- 4
- 创建认证文件
/home/svn/conf/authz
(示例)[svn@server-002 ~]$ vim conf/authz
[groups]
lse = hezhigang, shenfu, yangshuaifei
[/]
spancer = rw
[latRepo:/]
@lse = rw
* =
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
配置服务管理脚本
- 启动脚本start.sh
[svn@server-002 ~]$ vim start.sh
#!/bin/bash
svnserve -d -r /home/svn --config-file=/home/svn/conf/svnserve.conf --log-file=/home/svn/logs/svn.log
- 1
- 2
- 停止脚本stop.sh
[svn@server-002 ~]$ vim start.sh
#!/bin/bash
PID=$(ps -ef | grep svnserve | grep -v grep | awk '{ print $2 }')
if [ -z "$PID" ]
then
echo Application is already stopped
else
echo kill $PID
kill $PID
fi
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
配置开机启动
- 创建svn.service文件
[root@server-002 ~]# vim /etc/systemd/system/svn.service
[Unit]
Description=svn service
After=syslog.target
[Service]
Type=forking
ExecStart=/usr/bin/svnserve -d -r /home/svn --config-file=/home/svn/conf/svnserve.conf --log-file=/home/svn/logs/svn.log
User=svn
Group=svn
[Install]
WantedBy=multi-user.target
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 激活开机启动svn服务
[root@server-002 ~]# systemctl daemon-reload
[root@server-002 ~]# systemctl enable svn
添加http访问支持
- 检查是否已经安装了apache服务
[root@server-002 ~]# rpm -qa httpd
- 如果没有该服务,则安装,否则跳过
[root@server-002 ~]# yum install httpd -y - 安装mod_dav_svn组件
[root@server-002 ~]# yum install mod_dav_svn -y - 修改apache启动用户和组为svn
[root@server-002 ~]# vim /etc/httpd/conf/httpd.conf
User svn
Group svn
- 1
- 2
- 修改subversion.conf配置
[root@server-002 ~]# vim /etc/httpd/conf.d/subversion.conf
<Location /svn>
DAV svn
SVNListParentPath on
SVNParentPath /home/svn # 如果想在一个目录下面创建多个版本库的话,则使用SVNParentPath,否则SVNPath。
AuthType Basic
AuthName "svn Repo"
AuthUserFile /home/svn/conf/httpdpasswd
AuthzSVNAccessFile /home/svn/conf/authz
Require valid-user
</Location>
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 切换svn用户,创建密码文件并添加用户
[svn@server-002 ~]$ htpasswd -c -m /home/svn/conf/httpdpasswd admin
后续添加用户只需执行htpasswd /home/svn/conf/httpdpasswd <username>
开放80端口
[root@server-002 ~]# firewall-cmd –add-port=80/tcp –permanent
[root@server-002 ~]# firewall-cmd –reload启动apache
[root@server-002 ~]# systemctl start httpd
[root@server-002 ~]# systemctl enable httpd
添加apache支持后,如果不需要通过svn://192.168.1.2的形式访问,可以不用启动svn,直接启动httpd服务即可。如果二者都要支持,则httpd.service和svn.service都启动,但二者使用的密码文件不相同
centos7+apache+svn配置 踩坑,注意权限问题。apache应用目录checkout应用 必须用这个命令:svn co file:///home/svn/test/ test ,通过svn add * &&commit 及任意修改都是不行的的更多相关文章
- CentOS7.4安装MySQL踩坑记录
CentOS7.4安装MySQL踩坑记录 time: 2018.3.19 CentOS7.4安装MySQL时网上的文档虽然多但是不靠谱的也多, 可能因为版本与时间的问题, 所以记录下自己踩坑的过程, ...
- 记一次 Spring 事务配置踩坑记
记一次 Spring 事务配置踩坑记 问题描述:(SpringBoot + MyBatisPlus) 业务逻辑伪代码如下.理论上,插入数据 t1 后,xxService.getXxx() 方法的查询条 ...
- mybatis-generator:generate 生成代码配置踩坑详解
mybatis-generator:generate 生成代码配置踩坑不少,在此留下笔记以便后续填坑 一.mysql返回时间问题 错误信息: [ERROR] Failed to execute goa ...
- svn配置多仓库与权限控制
telnet: connect to address 47.106.115.228: Connection refused svn执行上下文错误由于目标计算机积极拒绝无法连接 标签: svn 2017 ...
- SVN配置以及自己主动部署到apache虚拟文件夹
SVN配置以及自己主动部署到apache虚拟文件夹 一.VisualSVN server 服务端和TortoiseSVNclient下载 VisualSVN下载:http://subversion.a ...
- Kafka SASL ACL配置踩坑总结
源起:工程现阶段中间件采用的是kafka.满足了大数据的高吞吐,项目间的解耦合,也增强了工程的容错率与扩展性.但是在安全这一块还有漏洞,kafka集群中,只要网站内的任何人知道kafka集群的ip与t ...
- Windows+Apache+Python+Django 踩坑记录
摘要 使用Python进行Web项目开发:相对于主流三大Web端解决方案(Java/.NET/PHP) Python在某些方面具有一定的优势,相对 Java/.NET 有更轻量级的部署方案,相对PHP ...
- XXLJOB2.1.0数据源配置踩坑记录
最近在看XXLJOB,因为截至到发文时间最新的版本是2.1.0而且需要建立的数据库与Quartz解耦了,所以就用了最新的版本. 首先说一下踩坑过程: 代码开发完成之后,在定时跑的时候第一次跑的多数失败 ...
- 在mac版virtual box中安装ubuntu虚拟机的NAT/Host-Only网络配置踩坑记录
之前用惯了vmware和parallels desktop,网络配置十分智能,基本不用自己配置.由于版权原因,工作电脑上换了免费的virtual box用,四五年都完全在虚拟机里干活的本菜鸡居然在虚拟 ...
随机推荐
- csvn使用入门
在前面我们已经配置好了csvn服务器,直达链接http://blog.csdn.net/qq_34829953/article/details/78285647 现在我们在win10环境下使用我们搭建 ...
- MySQL--数据库连接异常问题汇总
======================================================== Name or service not known 错误消息: [Warning] I ...
- linux 条件
1.文件状态测试-d 目录 -r 可读-f 常规文件 -w 可写-L 符号连接 -x 可执行-s 文件长度大于0,非空 -u 文件有suid位设置 示例: [ -s haison.c ] 0表示成功, ...
- skipper backend 负载均衡配置
skipper 对于后端是支持负载均衡处理的,支持官方文档并没有提供,实际使用中,这个还是比较重要的 同时支持健康检查. 格式 hello_lb_group: Path("/foo" ...
- APACHE REWRITE ? 匹配问号的写法
RewriteRule 不会去匹配 ? 后面的字符串,需要用RewriteCond来匹配 把 /abc?id=123 => /def.php?id=123 的写法: RewriteEng ...
- HBase源码分析之WAL
WAL(Write-Ahead Logging)是数据库系统中保障原子性和持久性的技术,通过使用WAL可以将数据的随机写入变为顺序写入,可以提高数据写入的性能.在hbase中写入数据时,会将数据写入内 ...
- apt-get update 与 apt-get upgrade 的区别
总而言之,update是更新软件列表,upgrade是更新软件:所以,这两命令都是一块用,update后再upgrade. update 是更新 /etc/apt/sources.list 和 /et ...
- vue-router 与 react-router 设计理念上的区别
vue-router 与 react-router 设计理念上的区别: 区别 vue-router react-router 改成history mode: 'history' 直接使用 react- ...
- 不能将“this”指针从“const SqQueue<ElementType>”转换为“SqQueue<ElementType> &
错误 1 error C2662: “int SqQueue<ElementType>::getLength(void)”: 不能将“this”指针从“const SqQueue<E ...
- centos7下yum安装mariadb
1.安装MariaDB 删除已安装的mysqlyum remove mysql mysql-server mysql-libs mysql-devel删除存放数据的目录rm -rf /var/lib/ ...