Centos5.4 yum安装svn

简介:

出自:http://blog.sina.com.cn/s/blog_53b95aec0100i638.html

 

http://wiki.centos.org/HowTos/Subversion

http://www.akii.org/2010-04/centos-install-configure-subversion-and-submitted-to-automatic-release/

查看linux详细版本命令

lsb_release -a

 

工具版本

svn   :svn, version 1.4.2

linux :CentOS release 5.4 (Final)

 

 SVN形式

1.yum install mod_dav_svn subversion httpd

(vim /etc/httpd/conf/httpd.conf -- Edit what you need and save the file
service httpd start
chkconfig httpd on

 

2.
cd /etc/httpd/conf.d/
vim subversion.conf
<Location /repos>
        DAV svn
        SVNPath /var/www/svn/repos
        AuthType Basic
        AuthName "Subversion repos"
        AuthUserFile /etc/svn-auth-conf
        Require valid-user
</Location>

 

在一个svn目录下建立多个项目的方法

vim /etc/httpd/conf.d/subversion.conf
更改 SVNPath =》 SVNParentPath
   SVNParentPath /var/www/svn/repos
 

这样在cd  /var/www/svn/repos/
svnadmin create testsvn1

在客户端就可以访问

 svn://192.168.255.71/testsvn1

 

3.

cd /var/www/
mkdir svn
cd svn
mkdir repos
cd repos

 

4.

cd  /var/www/svn/repos/
svnadmin create testsvn来创建一个库
chown  root.root testsvn给予apache的权限

 

5.开启svn

svnserve -d -r /var/www/svn/repos

 

6.配置

vim /var/www/svn/repos/testsvn/conf/svnserve.conf
anon-access = read
auth-access = write
password-db = passwd
authz-db = authz

 

当用show log 命令时候 会出现 'Item is not readable' 的问题解决办法
在snvserve.conf设置 anon-access = none
 

 

7.设置svn用户访问权限

7.1.单人登录
vim /var/www/svn/repos/testsvn/conf/passwd
gongyu=gongyu

vim /var/www/svn/repos/testsvn/conf/authz
[/]
* = rw

 

7.2.按组登录
当允许tester组进行删改操作时候 gongyu用户是不能进行修改工作的
vim /var/www/svn/repos/testsvn/conf/passwd
gongyu=gongyu
test = test
test1 = test1

 

vim /var/www/svn/repos/testsvn/conf/authz
[groups]
master = gongyu
tester = test,test1
[/]
@tester = rw

 

7.3按组和按文件夹目录分开控制权限
tester组用户可以读写src但不能读写doc
gongyu用户可以读写doc但不能读写src
vim /var/www/svn/repos/testsvn/conf/passwd
gongyu=gongyu
test = test
test1 = test1

vim /var/www/svn/repos/testsvn/conf/authz
[groups]
master = gongyu
tester = test,test1
[/]
@tester = rw
[testsvn:/doc]
gongyu  = rw
@tester = r
[testsvn:/src]
@tester = rw

 

8.关闭服务器防火墙或者开启端口

service iptables stop

开启防火墙端口
service iptables restart

vim /etc/sysconfig/iptables

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3690 -j ACCEPT
 

 

客户端运行

svn://192.168.255.71/testsvn

-------------------------------------------

svn+ssh形式

 

方法:ssh验证 需要svn服务器中创建真实linux用户名,使svn服务器允许此用户访问

      svn验证 需要对当前用户验证是否可以访问svn项目权限

 

http://blog.csdn.net/wangjingfei/archive/2010/03/28/5424338.aspx
1.yum install mod_dav_svn subversion

2.cd /etc/httpd/conf.d/
vim subversion.conf
<Location /repos>
        DAV svn
        SVNParentPath /var/www/svn/repos
        AuthType Basic
        AuthName "Subversion repos"
        AuthUserFile /etc/svn-auth-conf
        Require valid-user
</Location>

3.
cd /var/www/
mkdir svn
cd svn
mkdir repos
cd repos

4.

useradd zhaogongyu  添加用户
passwd zhaogongyu   添加密码
groupadd svn    添加svn用户组
usermod -a -G svn zhaogongyu 将用户添加到svn用户组

5.
cd  /var/www/svn/repos/
svnadmin create testsvn来创建一个库 
chown -R root.svn /var/www/svn/repos/testsvn69  
chmod -R g+rws | 775 /var/www/svn/repos/testsvn69    

6.开启svn
svnserve -d -r /var/www/svn/repos


7.配置

vim /var/www/svn/repos/testsvn69/conf/svnserve.conf
anon-access = none
auth-access = write
password-db = passwd
authz-db = authz


添加权限
vim /var/www/svn/repos/testsvn69/conf/authz
[groups]
svn = zhaogongyu
[/]
@svn = rw
#zhaogongyu = rw
* = rw

vim /var/www/svn/repos/testsvn69/conf/passwd
zhaogongyu=zhaogongyu


开启防火墙端口
service iptables restart

vim /etc/sysconfig/iptables

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3690 -j ACCEPT
 

8. 客户端访问地址
svn://192.168.255.69/testsvn69

9.增加ssh组件
yum install openssh-server

10.切换用户生成密钥
su zhaogongyu

cd /var/www/svn/repos/chinapaysvn/conf
ssh-keygen -b 1024 -t rsa -N zhaogongyu -f zhaogongyu
会在当前目录中生成密钥
zhaogongyu  zhaogongyu.pub

11.导入密钥
创建/home/zhaogongyu/.ssh 目录
mkdir /home/zhaogongyu/.ssh
拷入公钥文件
 cp /var/www/svn/repos/testsvn69/conf/zhaogongyu.pub /home/zhaogongyu/.ssh/authorized_keys

12.windows下运行
用pageant.exe, putty.exe, puttygen.exe
生成putty密钥
打开puttygen.exe
选择菜单:conversions->Import key
导入gongyu密钥文件
puTTygen:Enter Passphrase 输入gongyu
此时可以看到该密钥的一些信息。点击Save private key,生成ppk文件(假设保存为gongyu.ppk文件),即PuTTY使用的密钥。


13.svn运行
在svn checkout 时候输入
svn+ssh://zhaogongyu@192.168.255.69:/var/www/svn/repos/testsvn69

14.

添加新用户
useradd test  添加用户
passwd test   添加密码
usermod -a -G svn zhaogongyu 将用户添加到svn用户组


设置test 用户权限
vim /var/www/svn/repos/testsvn69/conf/authz
[groups]
svn       = zhaogongyu
developer = test
[/]
@svn = rw
@developer  = r
#gongyu = rw
* = rw

vim /var/www/svn/repos/testsvn69/conf/passwd
zhaogongyu = zhaogongyu
test       = test

切换用户生成密钥
su test

cd /var/www/svn/repos/chinapaysvn/conf
ssh-keygen -b 1024 -t rsa -N testsvn -f testsvn


创建/home/test/.ssh 目录
mkdir /home/test/.ssh
拷入公钥文件
 cp /var/www/svn/repos/testsvn69/conf/test.pub /home/test/.ssh/authorized_keys


本文转自holy2009 51CTO博客,原文链接:http://blog.51cto.com/holy2010/443324


相关文章
|
5天前
|
缓存 Ubuntu Linux
Linux中yum、rpm、apt-get、wget的区别,yum、rpm、apt-get常用命令,CentOS、Ubuntu中安装wget
通过本文,我们详细了解了 `yum`、`rpm`、`apt-get`和 `wget`的区别、常用命令以及在CentOS和Ubuntu中安装 `wget`的方法。`yum`和 `apt-get`是高层次的包管理器,分别用于RPM系和Debian系发行版,能够自动解决依赖问题;而 `rpm`是低层次的包管理工具,适合处理单个包;`wget`则是一个功能强大的下载工具,适用于各种下载任务。在实际使用中,根据系统类型和任务需求选择合适的工具,可以大大提高工作效率和系统管理的便利性。
54 25
|
17天前
|
监控 Linux
yum install -y net-snmp-devel 安装不成功 zabbix项目安装,Errors during downloading metadata for repository ‘extras-common’:问题解决方案-优雅草卓伊凡
yum install -y net-snmp-devel 安装不成功 zabbix项目安装,Errors during downloading metadata for repository ‘extras-common’:问题解决方案-优雅草卓伊凡
53 13
yum install -y net-snmp-devel 安装不成功 zabbix项目安装,Errors during downloading metadata for repository ‘extras-common’:问题解决方案-优雅草卓伊凡
|
15天前
|
监控 Linux PHP
【02】客户端服务端C语言-go语言-web端PHP语言整合内容发布-优雅草网络设备监控系统-2月12日优雅草简化Centos stream8安装zabbix7教程-本搭建教程非docker搭建教程-优雅草solution
【02】客户端服务端C语言-go语言-web端PHP语言整合内容发布-优雅草网络设备监控系统-2月12日优雅草简化Centos stream8安装zabbix7教程-本搭建教程非docker搭建教程-优雅草solution
65 20
|
22天前
|
Linux
Linux安装svn并启动
Linux安装svn并启动
55 10
|
1月前
|
存储 分布式计算 Hadoop
Centos7.9安装kerberos
Centos7.9安装kerberos
86 25
|
1月前
|
存储 Shell 网络安全
Centos7.9安装openldap
Centos7.9安装openldap
58 16
|
1月前
|
数据可视化 Linux 应用服务中间件
Centos7.9安装phpldapadmin
Centos7.9安装phpldapadmin
62 15
|
1月前
|
缓存 Linux
CentOS-6的iso下载地址镜像yum源
通过上述步骤,您可以成功下载CentOS 6的ISO镜像文件,并配置适用于CentOS 6的YUM源。尽管CentOS 6已经停止更新,但使用这些镜像和YUM源配置,可以继续在需要的环境中使用和维护CentOS 6系统。
391 20
|
1月前
|
网络协议 Java 应用服务中间件
centos7环境下tomcat8的安装与配置
本文介绍了在Linux环境下安装和配置Tomcat 8的详细步骤。首先,通过无网络条件下的文件交互软件(如Xftp 6或MobaXterm)下载并解压Tomcat安装包至指定路径,启动Tomcat服务并测试访问。接着,修改Tomcat端口号以避免冲突,并部署Java Web应用项目至Tomcat服务器。最后,调整Linux防火墙规则,确保外部可以正常访问部署的应用。关键步骤包括关闭或配置防火墙、添加必要的端口规则,确保Tomcat服务稳定运行。
|
1月前
|
Linux
CentOs9 yum源出现404问题
CentOs9-stream yum源出现404问题

热门文章

最新文章