CentOS 配置SVN

 环境 Centos 5 x86 


########下载源代码包##########

wget http://subversion.tigris.org/downloads/subversion-1.6.15.tar.gz;

wget http://subversion.tigris.org/downloads/subversion-deps-1.6.15.tar.gz;

wget http://mirror.bjtu.edu.cn/apache/httpd/httpd-2.2.21.tar.gz;

wget http://archive.apache.org/dist/apr/apr-1.4.2.tar.gz

wget http://archive.apache.org/dist/apr/apr-util-1.3.10.tar.gz


########下载源代码包##########

yum -y install gcc* openssl-devel expat-devel openssl openssl-devel libxml2-devel glibc-common gd-devel libtool;


########编译安装##############

###安装apr#########
tar zxvf apr-1.4.2.tar.gz;
cd apr-1.4.2;
./configure --prefix=/usr/local/apr;
make;
make install;
cd ..;

###报错
cannot remove `libtoolT': No such file or directory 
编译 configuer
把RM='$RM'改为RM='$RM  -f'

########安装apr-util########
tar zxvf apr-util-1.3.10.tar.gz;
cd apr-util-1.3.10;
./configure --with-apr=/usr/local/apr;
make;
make install;
cd ..;

###安装httpd
tar xf httpd-2.2.22.tar.gz 
cd httpd-2.2.22
./configure --prefix=/usr/local/apache --enable-dav --enable-so --enable-maintainer-mode --with-apr=/usr/local/apr/bin/apr-1-config --with-apr-util=/usr/local/apr/bin/apu-1-config 
 make
 make install
cd support/
 cp apachectl /etc/init.d/apache
chmod +x /etc/init.d/apache 

########安装subversion########
tar zxvf subversion-1.6.15.tar.gz;
tar zxvf subversion-deps-1.6.15.tar.gz;
cd subversion-1.6.15;
./configure --prefix=/usr/local/subversion --with-apxs=/usr/local/apache/bin/apxs --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr --without-berkeley-db;
make;
make install;


#############下面就是配置你的svn,这个需要你手动操作

1.建立svn版本库目录
mkdir -pv /home/svnroot/data
chown -Rv www /home/svnroot/data
chmod -Rv 755 /home/svnroot/data

2.建立svn版本库
/usr/local/subversion/bin/svnadmin create --fs-type fsfs /home/svnroot/data/project1
 
3.建立访问控制文件
/usr/local/apache/bin/htpasswd -c /home/svnroot/data/passwd  myname  #第一次加用户名
/usr/local/apache/bin/htpasswd  /home/svnroot/data/passwd  test1

4.建立本地项目控制文件
cd /home/svnroot/data
vi authz
[groups]        
admin=myname,test1 
[project1:/]
@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
添加

<Location /svn>
    DAV svn
    SVNParentPath /home/svnroot/data
    AuthType Basic
    AuthName "Subversion"
    AuthUserFile /home/svnroot/data/passwd
    AuthzSVNAccessFile /home/svnroot/data/authz
    Require valid-user
</Location>

5.启动apache
/usr/local/apache/bin/apachectl start

http://ip/svn/project1

完成。。。。
 

你可能感兴趣的:(SVN,centos)