How-To: Set up SVN with Apache2 in Linux (Ubuntu)

How-To: Set up SVN with Apache2 in Linux (Ubuntu)

Initially I didn’t plan on writing anything up about this, since its pretty basic to setup. But I ran into a slight problem, which I imagine others might run into also. I guess most would have Apache running already, so all that is needed is SVN:

Code:
> apt-get install subversion libapache2-svn

Say you have a domain already set up, call it abc.com. You want to be able to checkout a repository from abc.com/svn.

Open the following file (/etc/apache2/mods-available/dav_svn.conf) in an editor and follow the instructions. In the most basic form (with no authentication) you’ll have something like this when your done:

Code:
< Location /abc.com/svn >
DAV svn
SVNPath /svn
< /Location>

Inside the < Location /abc.com/svn > that path must point to a directory in your web server which does NOT exist. abc.com will exist, but make sure svn doesn’t. The SVNPath will point to the actual repository which MUST be outside your web server space.

This way, if you go to a browser and type: http://www.abc.com/svn nothing will show up, but when you checkout your repository, you will be re-directed to the actual svn directory (in this case /svn).

Now create the SVN repository, in directory /svn

Code:
> svnadmin create /svn

Be sure to change the permissions on this directory, so the web server can write to the folder:

Code:
> chown -R www-data /svn

Restart Apache2:

Code:
> /etc/init.d/apache2 -k restart

Now from a remote computer, you should be able to type:

Code:
svn co http://xxx.xxx.xxx.xx/abc.com/svn < name >

(were xxx.xxx.xxx.xxx is your server ip and name is what you want to call the local folder)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值