环境:centos 5.5 32位
软件版本:subversion-1.6.17.tar.gz subversion-deps-1.6.17.tar.gz httpd-2.2.17.tar.gz
1 安装apr和apr-util
- tar -zxvf subversion-deps-1.6.17.tar.gz
- cd subversion-1.6.17
- cd apr
- ./configure
- make
- make install
- cd ..
- cd apr-util/
- ./configure --with-apr=/usr/local/apr/
- make
- make install
- cd ../
2 安装apache
- tar -zxvf httpd-2.2.17.tar.gz
- cd httpd-2.2.17
- ./configure --prefix=/usr/local/httpd --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
3 安装subversion
- tar -zxvf subversion-1.6.17.tar.gz
- cd subversion-1.6.17
- ./configure --with-apxs=/usr/local/httpd/bin/apxs --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr
- make
- make install
4、查看subversion两个动态库有没有安装成功
cat /usr/local/httpd/conf/httpd.conf|grep LoadModule
看到下面两个模块说明安装成功
LoadModule dav_svn_module
modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
5、配置SVN
vi /usr/local/httpd/conf/httpd.conf 添加
Include conf/extra/svn.conf
vi /usr/local/httpd/conf/extra/svn.conf 添加如下代码
- <Location /svn>
- DAV svn
- SVNParentPath /data/svn/repos
- AuthType Basic
- AuthName "Subversion repository"
- AuthUserFile /data/svn/passwd
- AuthzSVNAccessFile /data/svn/auth
- Require valid-user
- </Location>
6、建立SVN存储仓库
#mkdir -p /data/svn/repos
#svnadmin create /data/svn/repos/test
7、建立本地访问控制文件
/usr/local/httpd/bin/htpasswd -c /data/svn/passwd liuhaiqing
输入两次密码即可
8、建立本地项目控制文件
touch /data/svn/auth 我的文件内容为:
- [groups]
- adminadmin_group = admin
- server_group = liuhaiqing,test
- [/]
- @admin_group = rw
- @server_group = rw
9 更改目录所有者
chown –R daemon. daemon /data/svn/repos
至此安装完毕
附:
1 svn添加用户
/usr/local/httpd/bin/htpasswd /data/svn/passwd test
输入两次密码
然后在 vi /data/svn/auth 在 server_group后面添加test
2 将apache添加到开机自启动
vi /etc/rc.d/rc.local 添加 /usr/local/httpd/bin/apachectl start
转载于:https://blog.51cto.com/liuhaiqing/616270