阿里云yum源安装svn一直报错 一直无法连接 http://mirrors.cloud.aliyuncs.com
配置163yum源
1,进入yum源配置目录
cd /etc/yum.repos.d
2,备份系统自带的yum源
mv CentOS-Base-Aliyun.repo CentOS-Base-Aliyun.repo.bak
下载163网易的yum源:
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
3,更新玩yum源后,执行下边命令更新yum配置,使操作立即生效
yum makecache
1.检查是否已安装
rpm -qa subversion
如果要卸载旧版本:
yum remove subversion
2.安装
yum install subversion
PS:yum install httpd httpd-devel subversion mod_dav_svn mod_auth_mysql(这是安装配合Apache的模块)
svnserve --version
如果成功会输出版本号
4.创建仓库目录
例如:
mkdir /home/data
5.创建项目
svnadmin create /home/data/game
6.检查是否创建成功
cd /home/data/game
ll
game目录下会多出几个文件夹
ll
[root@iZuf68jjsi2tempfjenhvnZ game]# ll
total 24
drwxr-xr-x 2 root root 4096 Aug 15 10:47 conf
drwxr-sr-x 6 root root 4096 Nov 29 19:40 db
-r--r--r-- 1 root root 2 Nov 23 2016 format
drwxr-xr-x 2 root root 4096 Nov 23 2016 hooks
drwxr-xr-x 2 root root 4096 Nov 23 2016 locks
-rw-r--r-- 1 root root 229 Nov 23 2016 README.txt
[root@iZuf68jjsi2tempfjenhvnZ game]# ls
conf db format hooks locks README.txt
[root@iZuf68jjsi2tempfjenhvnZ game]#
7.进入conf目录会看到3个配置文件,生成的文件中都有英文注释说明
示例需求:
服务端组:开后端读写
U3D组:开APP端读写
ART组:开美术读写
管理员组:所有的读写
authz:用户权限配置
U3D组:开APP端读写
ART组:开美术读写
管理员组:所有的读写
示例:
[groups]
manager = aa
server = bb,cc
client = dd
art = ee
u3d = ff,gg
mj2d = hh
[game:/]
@manager=rw
[game:/server]
@server=rw
[game:/client]
@client=rw
[game:/doc]
@server=r
@client=rw
[game:/doc/ui]
@art=rw
[game:/u3dclient]
@u3d=rw
[game:/gamedoc]
@art=rw
@u3d=rw
[game:/hzmj]
@u3d=rw
[game:/hzmj/guangdong]
@u3d=rw
@mj2d=rw
[game:/fish]
@art=rw
passwd:用户密码
manager = aa
server = bb,cc
client = dd
art = ee
u3d = ff,gg
mj2d = hh
[game:/]
@manager=rw
[game:/server]
@server=rw
[game:/client]
@client=rw
[game:/doc]
@server=r
@client=rw
[game:/doc/ui]
@art=rw
[game:/u3dclient]
@u3d=rw
[game:/gamedoc]
@art=rw
@u3d=rw
[game:/hzmj]
@u3d=rw
[game:/hzmj/guangdong]
@u3d=rw
@mj2d=rw
[game:/fish]
@art=rw
[users]
# harry = harryssecret
# sally = sallyssecret
zhou=zhou1234
chen=chen1234
svnserve.conf:
# harry = harryssecret
# sally = sallyssecret
zhou=zhou1234
chen=chen1234
[general]
anon-access = none
#匿名访问者权限
auth-access = write
#验证用户权限
password-db = passwd
#密码文件地址
authz-db = authz
#权限文件地址
# realm = My First Repository
anon-access = none
#匿名访问者权限
auth-access = write
#验证用户权限
password-db = passwd
#密码文件地址
authz-db = authz
#权限文件地址
# realm = My First Repository
8.开放svn端口
默认是3690端口,你也可以用别的。已开启的跳过这一步
修改
iptables -I INPUT -p tcp --dport 3690 -j ACCEPT
保存
/etc/rc.d/init.d/iptables save
重启
service iptables restart
查看
/etc/init.d/iptables status
iptables -I INPUT -p tcp --dport 3690 -j ACCEPT
保存
/etc/rc.d/init.d/iptables save
重启
service iptables restart
查看
/etc/init.d/iptables status
9.启动SVN服务
svnserve -d -r /home/data/
-d:守护进程
-r:svn根目录
假设服务端IP为192.168.1.100,那么如下设置后game的访问目录就为:
svn://域名/game
11.开机启动
编写一个启动脚本svn_startup.sh,/home/datat/svn_startup.sh
修改该脚本的执行权限
编写一个启动脚本svn_startup.sh,/home/datat/svn_startup.sh
#!/bin/bash
/usr/bin/svnserve -d -r /home/data/
/usr/bin/svnserve -d -r /home/data/
[root@iZuf68jjsi2tempfjenhvnZ data]# which svnserve
/usr/bin/svnserve
chmod 777 svn_startup.sh
加入自动运行
vi /etc/rc.d/rc.local
在末尾添加脚本的路径,如:
/home/data/svn_startup.sh
检查是否启动
在末尾添加脚本的路径,如:
/home/data/svn_startup.sh
[root@iZuf68jjsi2tempfjenhvnZ data]# ps -ef|grep svnserve
root 6679 1 0 Dec11 ? 00:00:00 /usr/bin/svnserve -d -r /home/data/ 可以看到启动的命令
root 12859 12626 0 09:53 pts/1 00:00:00 grep svnserve
[root@iZuf68jjsi2tempfjenhvnZ data]# netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:3690 0.0.0.0:* LISTEN 6679/svnserve 开放的端口
root 6679 1 0 Dec11 ? 00:00:00 /usr/bin/svnserve -d -r /home/data/ 可以看到启动的命令
root 12859 12626 0 09:53 pts/1 00:00:00 grep svnserve
[root@iZuf68jjsi2tempfjenhvnZ data]# netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:3690 0.0.0.0:* LISTEN 6679/svnserve 开放的端口