SVN环境安装
源码下载
wget http://archive.apache.org/dist/httpd/httpd-2.2.19.tar.bz2
wget http://www.sqlite.org/sqlite-amalgamation-3.6.13.tar.gz
wget http://subversion.tigris.org/downloads/subversion-deps-1.6.6.tar.bz2
wget http://subversion.tigris.org/downloads/subversion-1.6.17.tar.gz
1、安装apr apr-util
cd httpd-2.2.19/srclib/apr
./configure --prefix=/work/apr
make&&make install
cd ../apr-util
./configure --prefix=/work/apr-util --with-apr=/work/apr
make&&make install
2、apache安装
cd httpd-2.2.19
./configure --prefix=/work/webserver/httpd-2.2.19 --enable-dav --enable-so --with-apr=/work/apr/bin/apr-1-config --with-apr-util=/work/apr-util/bin/apu-1-config --with-included-apr
make && make install
3、Subversion安装
cd subversion-1.6.17
./configure --prefix=/work/webserver/svn --with-apxs=/work/webserver/httpd-2.2.19/bin/apxs --with-apr=/work/apr/bin/apr-1-config --with-apr-util=/work/apr-util/bin/apu-1-config --with-ssl --with-zlib=/usr --enable-maintainer-mode
make && make install
1) 安装报错:
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: cannot find -lexpat
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/librt.so when searching for -lrt
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/librt.a when searching for -lrt
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libcrypt.so when searching for -lcrypt
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libcrypt.a when searching for -lcrypt
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libpthread.so when searching for -lpthread
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libpthread.a when searching for -lpthread
collect2: ld returned 1 exit status
make: *** [subversion/svn/svn] Error 1
原因:缺少expat的库,安装expat2
解决方案:
去http://sourceforge.net/projects/expat/files/下载expat最新版本expat-2.1.0.tar.gz
#tar -zxvf expat-2.1.0.tar.gz
#cd expat-2.1.0
#./configure
#make&make install
继续执行步骤3(在执行前,make clean一下)
2) 安装报错
checking sqlite library version (via header)… unsupported SQLite version
checking sqlite library version (via pkg-config)… none or unsupported 3.3
no
An appropriate version of sqlite could not be found. We recommmend
3.6.13, but require at least 3.4.0.
Please either install a newer sqlite on this system
or
get the sqlite 3.6.13 amalgamation from:
http://www.sqlite.org/sqlite-amalgamation-3.6.13.tar.gz
unpack the archive using tar/gunzip and copy sqlite3.c from the
resulting directory to:
/work/webserver/svn/sqlite-amalgamation/sqlite3.c
This file also ships as part of the subversion-deps distribution.
configure: error: Subversion requires SQLite
按照以上提示下载sqlite-amalgamation-3.6.13.tar.gz
到svn所在目录
# mkdir sqlite-amalgamation
回到sqlite所在目录
[root@svn soft]# cp sqlite-3.6.13/sqlite3.c /work/webserver/svn/sqlite-amalgamation/
重新进行安装。
报如下BDB WARNING:
configure: WARNING: we have configured without BDB filesystem support
You don’t seem to have Berkeley DB version 4.0.14 or newer
installed and linked to APR-UTIL. We have created Makefiles which
will build without the Berkeley DB back-end; your repositories will
use FSFS as the default back-end. You can find the latest version of
Berkeley DB here:
http://www.oracle.com/technology/software/products/berkeley-db/index.html
make && make install
二、配置subversion
localhost ~ # groupadd svn
localhost ~ # useradd svn
注:如果增加不了,请参考mysql配置那篇博客
localhost ~ # PATH=$PATH:/work/webserver/svn/bin
localhost ~ # export PATH #把SVN命令加到默认路径
建立版本库目录,可建多个:
localhost ~ # mkdir –p /svndata/repos1
localhost ~ # mkdir /svndata/repos2
建立版本库:
localhost ~ #cd 解压目录下的 subversion-1.6.17/subversion/svnadmin/
localhost ~ # ./svnadmin create /svndata/repos1
localhost ~ # ./svnadmin create /svndata/repos2
以版本库1为例,配置版本库1:
localhost ~ # cd /svndata/repos1/
localhost repos1 # ls
README.txt conf db format hooks locks
看到上面目录与文件,说明版本库创建成功。
配置文件有如下三个:
localhost repos1 # ls conf/
authz passwd svnserve.conf
配置svnserve.conf:
localhost repos1 # vi conf/svnserve.conf
[general]
anon-access = none #去掉“#”将值“read”修改为“none”
auth-access = write
password-db = passwd
authz-db = authz
注:去掉这几行前面的“#”并前面不可以有空格,否则会报错
配置 passwd:
localhost repos1 # vi conf/passwd
[users]
liwei = 12345 #添加的用户,后面为密码
配置 authz:
[aliases] #此选项按默认
[groups]
admin = liwei #设置组,及其成员,添加用户使用“,”号隔开,如 admin=liwei,liwei1
[/] #设置根目录权限
liwei = rw
@admin = rw
[svndata:/repos1] #设置版本库1的权限
liwei = rw
修改权限:
localhost ~ # chown svn:svn –R /svndata
启动和停止SVN服务:
启动SVN服务:
localhost ~ # svnserve -d -r /svndata/
查看服务是否正常启动:
localhost ~ # netstat -auntp |grep 3690
tcp 0 0 0.0.0.0:3690 0.0.0.0:* LISTEN 20562/svnserve
停止SVN服务:
localhost ~ # killall svnserve
把某个目录里的资料加入到版本库里的方法:
localhost ~ # svn import directory/ file:///svndata/repos1 (把directory目录下的资料加入到版本库repos1里面)
客户端安装
在Windows上安装TortoiseSVN-1.6.16.21511-x64-svn-1.6.17.msi,根据提示安装即可,装完后从SVN服务器更新到本地: