六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 47|回复: 0

install svn server on centos

[复制链接]

升级  48.67%

33

主题

33

主题

33

主题

秀才

Rank: 2

积分
123
 楼主| 发表于 2013-1-28 22:02:41 | 显示全部楼层 |阅读模式
Source URL:
http://www.if-not-true-then-false.com/2010/install-svn-subversion-server-on-fedora-centos-red-hat-rhel/

Let's getting started now:
1. Change root usersu -## OR ##sudo -i2. Install needed packages (mod_dav_svn and subversion)yum install mod_dav_svn subversionNote: 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.confAdd following config to /etc/httpd/conf.d/subversion.conf file:LoadModule dav_svn_module     modules/mod_dav_svn.soLoadModule 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) usersUse following command:## Create testuser ##htpasswd -cm /etc/svn-auth-users testuserNew password: Re-type new password: Adding password for user testuser ## Create testuser2 ##htpasswd -m /etc/svn-auth-users testuser2New password: Re-type new password: Adding password for user testuser25. Create and configure SVN repositorymkdir /var/www/svncd /var/www/svn svnadmin create testrepochown -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/testrepoRestart Apache:/etc/init.d/httpd restart## OR ##service httpd restart6. Configure repositoryTo 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 = authz7. Create trunk, branches and tags structure under testrepoCreate “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/trunkAdding         /tmp/svn-structure-template/branchesAdding         /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;
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表