tar xjvf httpd-2.2.18.tar.bz2
cd httpd-2.2.18
./configure --prefix=/opt/apache --enable-so --enable-dav --enable-dav-fs --enable-maintainer-mode --with-included-apr --enable-rewrite --
enable-proxy --enable-proxy-http
--enable-so 开启动态库支持,svn要求apache必须启用so
--enable-dav --enable-dav-fs 是支持svn认证使用的
--enable-maintainer-mode 开启调试模式
--with-included-apr 使用内置的apr
--enable-rewrite 开启rewrite
--enable-ssl 开启SSL
--enable-proxy 开启proxy支持
--enable-proxy-http 开启proxy http支持
make
make install
创建apache用户
useradd -M apache
修改apache配置文件,让它以用户apache身份运行
vi /opt/apache/conf/httpd.conf
++++++++++++++++++++++++++++++
User apache
Group apache
++++++++++++++++++++++++++++++

2.编译安装subversion
wget http://subversion.tigris.org/downloads/subversion-1.6.13.tar.bz2
wget http://subversion.tigris.org/downloads/subversion-deps-1.6.13.tar.bz2
subversion-deps-1.6.13.tar.bz2是subversion的依赖包,解压后会自动放在先解压的subversion-1.6.13目录中;
tar jxvf subversion-1.6.13.tar.bz2
tar jxvf subversion-deps-1.6.13.tar.bz2
cd subversion-1.6.13
./configure --prefix=/opt/subversion --with-apxs=/opt/apache/bin/apxs --with-apr=/opt/apache/bin/apr-1-config --with-apr-
util=/opt/apache/bin/apu-1-config
make(若报/usr/bin/ld: cannot find -lexpat错,解压安装export 然后export CPPFLAGS=-I/usr/local/expat-2.0.1/lib 然后编译)
make install
编辑apache配置文件使其与subversion相融合
vi /opt/apache/conf/httpd.conf
检查是否存在这两行,并确保在/opt/apache/modules目录下存在mod_dav_svn.so和mod_authz_svn.so这两个文件
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
添加以下两行
# Subversion default settings
Include conf/extra/httpd-svn.conf
创建配置文件
cd /opt/apache/conf/extra/
vi httpd-svn.conf
<Location /svn>
DAV svn
SVNListParentPath ON
SVNParentPath /data/svn_repo
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /opt/subversion/conf/svn_passwdfile
AuthzSVNAccessFile /opt/subversion/conf/svn_accessfile
Require valid-user
</Location>
创建subversion核心配置文件
cd /opt/subversion
mkdir conf
创建账户配置文件,回车后会提示输入密码两次,因为是第一次创建,svn_passwdfile文件原本不存在所以需要加-c参数,之后就直接输入用户名和密码即可
/opt/apache/bin/htpasswd -c /opt/subversion/conf/svn_passwdfile Songxy
创建权限配置文件
vi /opt/subversion/conf/svn_accessfile
[groups]
g_manager = Songxy
[project1:/]
@g_manager = rw
* = r
创建仓库主目录
mkdir -p /data/svn_repo
创建测试仓库project1
/opt/subversion/bin/svnadmin create /data/svn_repo/project1
修改仓库权限
chown -R apache:apache /data/svn_repo
启动apache
/opt/apache/bin/apachectl start
测试能否正常访问
http://192.168.1.100/svn/project1/
输入之前创建的Songxy用户的账号与密码