一.安装apache2.2.15
1.安装软件:
./configure --enable-dav --enable-so --prefix=/opt/www
说明:--enable-dav,安装dav模块;
--enable-so,允许动态添加apache模块;
然后执行make,make install;
2.运行httpd:
/opt/www/bin/apachectl start
二.安装subversion
1.下载及安装相关软件:
http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=260&expandFolder=74
下载subversion和subversion-deps源码包(注意:版本要一致!)
2.安装依赖包:
subversion依赖包包括:libarp libapr-util sqlite libz等(其中libarp是Apache portable Run-time libraries,Apache可移植运行库)。以上依赖包都在subversion-deps-1.6.0.tar.gz中,解压缩到安装包同一目录下,安装时自动安装,不需要单独安装。
另外需求安装:openssl,openssl-devel;如果不安装openssl相关包,./configure时会以下错误:
configure: error: We require OpenSSL; try --with-openssl
configure failed for serf
3.安装subversion:
进入解压包目录后,执行;
./configure --prefix=/opt/svn --with-apxs=/opt/www/bin/apxs
make
make install
4.创建版本库:
/opt/svn/bin/svnadmin create /var/svndata
创建版本库名为“svndata”,目录路径为:/var/svndata
PS:通过查看httpd.conf文件中
User daemon
Group daemon
得知http服务是使用daemon启动的,所以要修改svndata的属性!
chown -R daemon:daemon /var/svndata/
修改目录的读写权限:
chmod -R 700 /var/svndata
5,修改httpd.conf文件,使subversion能通过http访问!添加以下语句:
<Location /repos>
DAV svn
SVNPath /var/svndata
</Location>
作用:http://ipaddress/repos/;这样当输入这个url时,会访问到/var/svndata目录!
6.添加mysql认证模块到apache:
1)下载地址:http://www.heuer.org/mod_auth_mysql/
下载模块到/modules目录,根据“README”提示,修改名字,并且修改权限!
a precompiled i386 module for apache 2.2.x,you should rename the module to mod_auth_mysql.so
it needs libmysqlclient.so.15(需要安装mysql-client包)
2)在httpd.conf目录添加如下代码:
LoadModule auth_mysql_module modules/mod_auth_mysql.so
重启httpd服务,看有无报错,然后执行
/opt/www/bin/apachectl -M |grep mysql
auth_mysql_module (shared)
如果出现以上画面代表module加载成功!
svn客户端下载:
http://tortoisesvn.net/downloads
本文转自 shine_forever 51CTO博客,原文链接:http://blog.51cto.com/shineforever/306116