1、所需软件包
apr-util-1.5.4.tar.gz #下载地址 wget http://mirrors.tuna.tsinghua.edu.cn/apache/apr/apr-util-1.5.4.tar.gz
apr-1.5.2.tar.gz #下载地址 wget http://mirrors.tuna.tsinghua.edu.cn/apache/apr/apr-1.5.2.tar.gz
sqlite-autoconf-3071700.tar.gz #下载地址
wget http://www.sqlite.org/2013/sqlite-autoconf-3071700.tar.gz
subversion-1.8.13.tar.gz #下载地址 wget http://mirrors.hust.edu.cn/apache/subversion/subversion-1.8.13.tar.gz
httpd-2.2.29.tar.gz #下载地址 wget http://mirrors.cnnic.cn/apache//httpd/httpd-2.2.29.tar.bz2
2、创建管理用户
[[email protected] ~]# groupadd benet
[[email protected] ~]# useradd -d /opt/benet -g benet benet
[[email protected] ~]# echo "benet" | passwd --stdin benet
3、创建软件包目录soft、安装目录app、库文件目录applib
[[email protected] ~]# cd /opt/
[[email protected] opt]# mkdir soft
[[email protected] opt]# mkdir applib
[[email protected] opt]# mkdir app
4、安装httpd
[[email protected]localhost soft]# tar xf httpd-2.2.29.tar.gz
[[email protected] soft]# cd httpd-2.2.29
[[email protected] httpd-2.2.29]# ./configure --prefix=/opt/app/apache --enable-dav --enable-so --enable-modules=most
[[email protected] httpd-2.2.29]# make
[[email protected] httpd-2.2.29]# make install
5、安装apr
[[email protected] soft]# tar xf apr-1.5.2.tar.gz
[[email protected] soft]# cd apr-1.5.2
[[email protected] apr-1.5.2]# ./buildconf ## ./buildconf #验证系统是否已经安装python、autoconf、libtool,如果没有安装,使用yum或rpm方式安装相应包即可。
buildconf: checking installation...
buildconf: python version 2.7.8 (ok)
buildconf: autoconf version 2.63 (ok)
buildconf: libtool version 2.2.6b (ok)
buildconf: copying libtool helper files using /usr/bin/libtoolize
buildconf: creating include/arch/unix/apr_private.h.in ...
buildconf: creating configure ...
buildconf: generating ‘make‘ outputs ...
buildconf: rebuilding rpm spec file
[[email protected] apr-1.5.2]# ./configure --prefix=/opt/app/apr --libdir=/opt/applib/
[[email protected] apr-1.5.2]# make
[[email protected] apr-1.5.2]# make install
6、安装apr-util
[[email protected] soft]# tar xf apr-util-1.5.4.tar.gz
[[email protected] soft]# cd apr-util-1.5.4
[[email protected] apr-util-1.5.4]# ./configure --prefix=/opt/app/apr-util --with-apr=/opt/app/apr
[[email protected] apr-util-1.5.4]# make
[[email protected] apr-util-1.5.4]# make install
[[email protected] ~]# echo "/opt/applib/" >> /etc/ld.so.conf.d/applib.conf ##由于安装apr是指定了库文件位置为/opt/applib所以需要添加到共享库中否则启动Apache是会找不到apr
[[email protected] ~]# ldconfig
7、安装sqlite
[[email protected] soft]# tar xf sqlite-autoconf-3071700.tar.gz
[[email protected] soft]# cd sqlite-autoconf-3071700
[[email protected] sqlite-autoconf-3071700]# ./configure --prefix=/opt/app/sqlite
[[email protected] sqlite-autoconf-3071700]# make
[[email protected] sqlite-autoconf-3071700]# make install
8、安装subversion
[[email protected] soft]# tar xf subversion-1.8.13.tar.gz
[[email protected] soft]# cd subversion-1.8.13
[[email protected] subversion-1.8.13]# ./configure --prefix=/opt/app/subversion --with-apxs=/opt/app/apache/bin/apxs --with-apr=/opt/app/apr/bin/apr-1-config --with-apr-util=/opt/app/apr-util/bin/apu-1-config --with-sqlite=/opt/app/sqlite/ --with-opensll --with-zlib--enable-maintarner-mod
[[email protected] subversion-1.8.13]# make
[[email protected] subversion-1.8.13]# make install
9、创建SVN仓库
[[email protected] ~]# mkdir /opt/svnroot/oa -p #创建svn数据库目录
[[email protected] ~]# chmod -R 777 /opt/ #为了测试方便赋予/opt目录777权限
[[email protected] ~]# /opt/app/subversion/bin/svnadmin create /opt/svnroot/oa/test #使用svnadmin create 创建一个名为test的库
10、创建权限配置文件
[[email protected] ~]# vi /opt/svnroot/oa/authz.conf #添加如下内容
[/]
* = r ##表示对所有用户开放的权限
[test:/]
wangenzhi = rw ##表示对wangenzhi这个用户开放的权限
11、创建用户认证文件
[[email protected] ~]# /opt/app/apache/bin/htpasswd -c /opt/svnroot/oa/authfile wangenzhi
12、加载模块
##subversion安装完成以后会在/opt/app/subversion/libexec/目录下生成mod_authz_svn.so mod_dav_svn.so 两个模块,将这两个模块拷贝到/opt/app/apache/modules目录下
[[email protected] ~]# cd /opt/app/subversion/libexec/
[[email protected] libexec]# ls
mod_authz_svn.so mod_dav_svn.so
[[email protected] ~]# cp /opt/app/subversion/libexec/* /opt/app/apache/modules/
13、编辑Apache配置文件
[[email protected] ~]# cp /opt/app/apache/conf/httpd.conf /opt/app/apache/conf/httpd.conf.bak #做任何操作之前先将配置文件备份一份
[[email protected] ~]# vi /opt/app/apache/conf/httpd.conf
User benet #66行修改为benet
Group benet #修67行改为benet
ServerName www.example.com:80 #去掉本行前面注释
# LoadModule foo_module modules/mod_foo.so
# 添加如下两行
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
#最后一行下面添加如下内容保存退出
<Location /oa>
DAV svn
SVNParentPath "/opt/svnroot/oa"
AuthzSVNAccessFile "/opt/svnroot/oa/authz.conf"
AuthType Basic
AuthName "Subversion.zoneyump"
AuthUserFile "/opt/svnroot/oa/authfile"
Require valid-user
</location>
14、启动Apache
[[email protected] ~]# /opt/app/apache/bin/apachectl start
[[email protected] ~]# service iptables stop ##为了测试将防火墙关掉
15、使用SVN客户端测试
16、使用Windows下的TortoiseSVN客户端chkout 下载操作,Windows下安装TortoiseSVN这里不再演示按照默认下一步安装即可。下载TortoiseSVN,百度TortoiseSVN即可
######################至此安装结束,写的不好请大家多多指点。谢谢###########################