linux上源码安装subversion+apache
小生是个linux菜鸟, 读了N篇文档,终于在2台 linux机器上成功装好了subversion+apache
记录安装步骤如下:
1. 下载svn相关源码
http://subversion.tigris.org/servlets/NewsItemView?newsItemID=1807
下载了
http://subversion.tigris.org/downloads/subversion-1.4.3.zip
http://subversion.tigris.org/downloads/subversion-deps-1.4.3.tar.gz
2. 按照svn INSTALL文档一步一步做:
$ tar xzvf subversion-1.x.x.tar.gz
$ tar xzvf subversion-deps-1.x.x.tar.gz
$ cd subversion-1.x.x
$ ./configure
$ make && make install
2台机器中有一台机器是64位的CPU, make的时候提示出错:
a local symbol' can not be used when making a shared object; recompile with
-fPI
于是重新弄一把:
make clean
./configure CFLAGS=-fPIC
make && make install
3 接下来源码安装apache,
svn co http://svn.apache.org/repos/asf/httpd/httpd/branches/2.0.x httpd-2.0
$ cd httpd-2.0/srclib
$ svn co http://svn.apache.org/repos/asf/apr/apr/branches/0.9.x apr
$ svn co http://svn.apache.org/repos/asf/apr/apr-util/branches/0.9.x apr-util
$ cd ..
$ ./buildconf (这里如果提示libtool没装...恭喜你..你只好先把libtool装好,上网下载RPM即可)
$ ./configure --enable-dav --enable-so
$ make && make install
4
apache搞定后, 重新编译一把svn,会把相关的.so拷贝到apache目录
在刚才的subversion-1.x.x目录下
$ ./configure --with-apxs=/usr/local/apache2/bin/apxs
$ rm /usr/local/lib/libsvn*
$ make clean && make && make install
5 建立svn 仓库根目录和配置apache
建立文件夹/var/svn/repos
配置apache:
<Location /svn>
DAV svn
SVNParentPath /var/svn/repos
</Location>
重启apache
6 很重要的一步:
NOTE:
Make sure that the user 'nobody' (or whatever UID the
httpd process runs as) has permission to read and write the
Berkeley DB files! This is a very common problem.
chown -R nobody:nobody /var/svn/repos
7. 建立一个svn 仓库
cd /var/svn/repos
svnadmin create TEST
然后随便cd到一个目录,随便建几个文件:
cd /home/xxxx/
mkdir test
cd test
mkdir trunk
mkdir branches
svm import http://localhost/svn/TEST -m "Initial repository"
搞定!
试试check out:
svn co http://localhost/svn/TEST