install svn server on centos

本文详细介绍了如何在Fedora CentOS Red Hat RHEL上安装SVN Subversion服务器,包括更改root用户、安装所需包、配置Subversion配置文件、添加SVN用户、创建和配置SVN仓库等步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Source URL:
[url]http://www.if-not-true-then-false.com/2010/install-svn-subversion-server-on-fedora-centos-red-hat-rhel/[/url]

Let's getting started now:

1. Change root user

su -
## OR ##
sudo -i

2. Install needed packages (mod_dav_svn and subversion)

yum install mod_dav_svn subversion

Note: If you don’t have Apache installed already, this command installs it also. Read more about installing Apache and PHP >>
3. Modify Subversion config file /etc/httpd/conf.d/subversion.conf

Add following config to /etc/httpd/conf.d/subversion.conf file:

LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

<Location /svn>
DAV svn
SVNParentPath /var/www/svn
AuthType Basic
AuthName "Subversion repositories"
AuthUserFile /etc/svn-auth-users
Require valid-user
</Location>

4. Add SVN (Subversion) users

Use following command:

## Create testuser ##
htpasswd -cm /etc/svn-auth-users testuser
New password:
Re-type new password:
Adding password for user testuser

## Create testuser2 ##
htpasswd -m /etc/svn-auth-users testuser2
New password:
Re-type new password:
Adding password for user testuser2

5. Create and configure SVN repository

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

svnadmin create testrepo
chown -R apache.apache testrepo

chcon -R -t httpd_sys_content_t /var/www/svn/testrepo

## Following enables commits over http ##
chcon -R -t httpd_sys_rw_content_t /var/www/svn/testrepo

Restart Apache:

/etc/init.d/httpd restart
## OR ##
service httpd restart


6. Configure repository

To disable anonymous access and enable access control add following rows to testrepo/conf/svnserve.conf file:

## Disable anonymous access ##
anon-access = none

## Enable access control ##
authz-db = authz

7. Create trunk, branches and tags structure under testrepo

Create “template” directories with following command:

mkdir -p /tmp/svn-structure-template/{trunk,branches,tags}

Then import template to project repository using “svn import” command:

svn import -m 'Initial import' /tmp/svn-structure-template/ http://localhost/svn/testrepo/
Adding /tmp/svn-structure-template/trunk
Adding /tmp/svn-structure-template/branches
Adding /tmp/svn-structure-template/tags

Committed revision 1.



配置防火墙使得本机的80端口可以被远程访问
依次输入命令:
/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT
/etc/rc.d/init.d/iptables save
/etc/init.d/iptables restart

## make the network usable automatically.

/etc/sysconfig/networking/device/ifcfg-eth0
/etc/rc.d/init.d/network restart
or
ifdown eth0;
ifup eth0;

1.权限设置 http://blog.sina.com.cn/s/blog_53b95aec0100i638.html
2.强行添加注释 http://www.frostsky.com/2012/01/svn-hook-commit/
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值