在Ubuntu上安装SVN服务器

1.安装ubuntu开发环境

 
apt-get install build-essential make

2.安装autoconf libtoold

 
apt-get install autoconf
apt-get install libtool

3.安装apr-1.2.12

 
gzip -d apr-1.4.6.tar.gz
tar -zxvf apr-1.4.6.tar
cd apr-1.4.6
./buildconf
./configure
make
make install

4.安装 apr-util-1.2.12

 
tar -zxvf apr-util-1.5.1.tar.gz
cd apr-util-1.5.1/
./configure –with-apr=/usr/local/apr
make
make install

5.安装zlib

 
gzip -d zlib-1.2.5.tar.gz
tar zxvf zlib-1.2.5.tar
cd zlib-1.2.5/
./configure –prefix=/usr/local/zlib
make
make install

6.安装sqlite-amalgamation

 
tar zxvf sqlite-amalgamation-3.6.13.tar.gz
cd sqlite-3.6.13/
./configure –prefix=/usr/local/sqlite
make
make install

7.安装neon

 
tar xf neon-0.29.6.tar.gz
cd neon-0.29.6
./configure –prefix=/usr/local/neon
make
make install

8.安装apache

 
tar zxvf httpd-2.2.9.tar.gz
cd httpd-2.2.9/
./configure –prefix=/usr/local/apache –enable-dav –enable-so –enable-maintainer-mode –enable-rewrite –with-apr=/usr/local/apr/bin/apr-1-config –with-apr-util=/usr/local/apr/bin/apu-1-config
make
make install

9.安装svn

 
./configure –prefix=/usr/local/svn –with-apxs=/usr/local/apache/bin/apxs –with-apr=/usr/local/apr –with-apr-util=/usr/local/apr –with-apr=/usr/local/apr/bin/apr-1-config –with-apr-util=/usr/local/apr/bin/apu-1-config –with-sqlite=/usr/local/sqlite –with-ssl –with-zlib=/usr/local/zlib –with-neon=/usr/local/neon/bin –enable-maintainer-mode

1.建立svn版本库目录

 
mkdir -pv /usr/local/svn_rep
chown -Rv www-data /usr/local/svn_rep
chmod -Rv 755 /usr/local/svn_rep

2.建立svn版本库

 
/usr/local/subversion/bin/svnadmin create –fs-type fsfs /usr/local/svn_rep/project

3.建立访问控制文件

 
/usr/local/apache/bin/htpasswd -c /etc/svn/passwd  cesc#第一次加用户名
/usr/local/apache/bin/htpasswd  /etc/svn/passwd  theo

4.建立本地项目控制文件

 
cd /usr/local/svn_rep
vi authz
[groups]
admin=cesc,theo

[project:/]
@admin = rw

cat /usr/local/apache/conf/httpd.conf | grep svn
显示

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

vi /usr/local/apache/conf/httpd.conf
添加

 

DAV svn
SVNParentPath /home/svnroot/data
AuthType Basic
AuthName “Subversion”
AuthUserFile /home/svnroot/data/passwd
AuthzSVNAccessFile /home/svnroot/data/authz
Require valid-user

5.启动apache

 
/usr/local/apache/bin/apachectl start

访问

http://ip/svn/project

发表评论

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