linux下SVN+apache搭建

本文详细介绍了在CentOS 6环境下编译安装Apache与Subversion的过程,并针对编译过程中可能出现的问题提供了具体的解决方案。同时,还提供了如何配置Apache来支持Subversion服务的方法。
下载包
wget  http://syslab.comsenz.com/downloads/linux/httpd-2.2.11.tar.gz
wget  http://subversion.tigris.org/downloads/subversion-1.5.3.tar.gz

1. 编译apache
tar zxvf httpd-2.2.11.tar.gz
cd  httpd-2.2.11
./configure   --enable-dav --enable-dav-fs --enable-so   --enable-ssl --enable-maintainer-mode -prefix=/usr/local/apache2   --enable-mods-shared=all
make  && make install
问题: 在centos6系统中,如果增加了 --enable-ssl 会一直报错编译不成功,即使我们yum install  openssl-devl 也不行,这是因为centos6中yum安装的openssl版本和httpd-2.2.11所要求的版本不一致,解决办法:下载更新的 httpd(2.4.6没有问题)或者源码编译安装openssl(0.9版本)


2. 编译subversion

tar zxvf  subversion-1.5.3.tar.gz
cd subversion-1.5.3
./configure --prefix=/usr/local/subverion --with-apxs=/usr/local/apache2/bin/apxs --with-apr=/usr/local/src/httpd-2.2.11/srclib/apr/  --with-apr-util=/usr/local/src/httpd-2.2.11/srclib/apr-util --with-ssl 
make && make install 

3.  添加svn用户 
useradd SVN

4. 创建仓库
/usr/local/subverion/bin/svnadmin create /home/SVN/lishiming

5. 测试svn
添加一个文件到仓库   /usr/local/subverion/bin/svn   import    /tmp/disk.txt     file:///home/SVN/lishiming/disk.txt  -m test
其中 命令格式为 svn  import  filename svn仓库路径 -m  说明
查看添加的文件信息  /usr/local/subverion/bin/svn list --verbose file:///home/SVN/lishiming/

6. 整合apache
vim /usr/local/apache2/conf/httpd.conf
在最后面加入
<Location /lishiming>
   DAV svn
   SVNPath /home/SVN/lishiming
   AuthzSVNAccessFile /home/SVN/lishiming/conf/authz.conf
   AuthType Basic
   AuthName "Subversion"
   AuthUserFile /home/SVN/authfile
   Require valid-user
</Location>

另外需要修改一下 
User  SVN
Group  SVN


7. 添加认证用户
/usr/local/apache2/bin/htpasswd -c /home/SVN/authfile svntest  

说明:第一次创建这个用户是需要加-c 选项,以后再次创建就不需要了,因为authfile 文件已经存在

8. 编辑用户权限
vim /home/SVN/lishiming/conf/authz.conf   内容如下:
[lishiming:/]
svntest = rw 

9. 更改权限
chown -R SVN:SVN /home/SVN/

10. 重启apache

访问 10.0.2.111/lishiming/


本文转自 a928154159 51CTO博客,原文链接:http://blog.51cto.com/zhibeiwang/1787773


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值