subversion安装备忘

1. 所需软件包清单
a. apr-1.3.3.tar.gz
b. apr-util-1.3.4.tar.gz
获取地址: http://apr.apache.org/
c.neon-0.28.3.tar.gz
获取地址:http://www.webdav.org/neon/
d. subversion-1.5.4.tar.bz2
获取地址: http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=260&expandFolder=74
e. httpd-2.2.10.tar.gz
获取地址: http://httpd.apache.org/

2. 安装步骤
a. apr安装

hqlong@hqlong:~$ tar zxvf apr-1.3.3.tar.gz
....
....
hqlong@hqlong:~$ cd apr-1.3.3/
hqlong@hqlong:~/apr-1.3.3$ ./configure --prefix=/usr/local/apr
....
....
hqlong@hqlong:~/apr-1.3.3$ make && sudo make install
....
....

b. apr-util安装

hqlong@hqlong:~$ tar zxvf apr-util-1.3.4.tar.gz
...
...
hqlong@hqlong:~$ cd apr-util-1.3.4/
hqlong@hqlong:~$ ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
...
...
hqlong@hqlong:~$ make && sudo make install
...
...

c. neno安装

hqlong@hqlong:~$ tar zxvf neon-0.28.3.tar.gz
...
...
hqlong@hqlong:~$ cd neon-0.28.3/
hqlong@hqlong:~/neon-0.28.3$ ./configure --prefix=/usr/local/neon
...
...
hqlong@hqlong:~/neon-0.28.3$ make && sudo make install
...
...

d. apache安装或者重新编译

如果先前装有apache,这里需要重新编译,而且apache自己的apr和apr-util这两库可能这里会有不兼容,所以在编译apache时,需要指定我们新安装的这两个库的位置。

否则需要全新安装。

hqlong@hqlong:~/httpd-2.2.10$ ./configure --prefix=/usr/local/apache
--enable-mpm-worker
--enable-so
--enable-dav=share
--enable-dav-fs
--with-apr=/usr/local/apr
--with-apr-util=/usr/local/apr-util
...
...
hqlong@hqlong:~/httpd-2.2.10$ make && sudo make install
...
...

d. subversion安装

hqlong@hqlong:~$ tar jxvf subversion-1.5.4.tar.bz2
...
...
hqlong@hqlong:~$ cd subversion-1.5.4/
hqlong@hqlong:~/subversion-1.5.4$ ./configure --prefix=/usr/local/subversion
--with-apxs2=/usr/local/apache/bin/apxs
--with-apr=/usr/local/apr
--with-apr-util=/usr/local/apr-util
--with-neon=/usr/local/neon
...
...
hqlong@hqlong:~/subversion-1.5.4$ make && sudo make install
...
...

3. 相关配置

检查/usr/local/apache/conf/httpd.conf是否有

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

如果没有自动添加这两行,重新编译svn

在httpd.conf最后添加如下代码

<Location /svn>
    DAV svn
    SVNParentPath /home/hqlong/svn
    SVNListParentPath off
    AuthType Basic
    AuthName "svn repository"
    AuthUserFile /home/hqlong/svn/passwd
    #AuthzSVNAccessFile /home/hqlong/svn/auth
    Require valid-user
</Location>

创建源目录

hqlong@hqlong:~$ sudo mkdir svn
hqlong@hqlong:~$ cd svn
hqlong@hqlong:~/svn$ mkdir trunk
hqlong@hqlong:~/svn$ sudo mkdir -R 777 trunk

为svn添加一个test访问用户

hqlong@hqlong:~$ sudo /usr/local/apache/bin/htpasswd -c passwd test password:
Re-type new password:

启动apache

hqlong@hqlong:~$ sudo /usr/local/apache/bin/apachectl -k start

为了操作方便,将svn bin目录添加的环境变量中。

在/etc/profile中添加如下代码

export PATH="$PATH:/usr/local/subversion/bin"

注销后重新登录

4.简单使用

hqlong@hqlong:~/svn$ svnadmin create trunk

这里会发现trunk目录下会多出几个文件

这里我们的SVN访问地址为

http://192.168.2.228/svn/trunk

当然也可能在svn目录创建其它项目的仓库

导入控制源码

hqlong@hqlong:~$ sudo svn import
/home/hqlong/svn1/trunk file:///usr/local/apache/htdocs/wwwroot -m "Initial import"

客户端checkout源码

hqlong@hqlong:~/www$ svn co http://192.168.2.228/svn/trunk
A    trunk/frontend_app
A    trunk/frontend_app/tmp
A    trunk/frontend_app/tmp/cache
A    trunk/frontend_app/tmp/session
...
...

这里只是简单列了一下操作步骤,以作备忘之用,当然在实际编译里,会遇到各种各样的问题,其实只要一步一步的解决,最终都会慢慢解决的,对于访问里出现什么权限拒绝访问之类的问题,十有八九都是目录权限的设置问题,这里为了方便起见,全设置成777,如果要对访问权限作更细的颗粒化设置,可参考手册,设置步骤十分详细。

机器人 2008-11-12 17:55 于 北京

此条目发表在 linux/server 分类目录,贴了 , , 标签。将固定链接加入收藏夹。

subversion安装备忘》有 9 条评论

  1. I concede, I have not seen this webpage for a long time, however, it was another pleasure to see such a important elements and ignore it. Thanks for assisting making people realize that fantastic ideas.

  2. I generally agree with your points. We all obtain a benefit from this good post. This web-site is fantastic. I have mastered some things from here. Thank you.

  3. Andrew Alden~ Before speaking consider the interpretation of your words as well as their intent.

  4. I prefer this web site its a master element! Happy I spotted this on google.

  5. Pingback 引用通告: best halloween creative ideas and horror artwork

  6. Pingback 引用通告: best free designs

  7. Pingback 引用通告: This is why this video will make you like Indie Euro Rock again!

  8. Pingback 引用通告: divi 3

  9. Pingback 引用通告: download app mock up.psd

发表评论

电子邮件地址不会被公开。 必填项已用*标注

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>