Centos6.5源码搭建SVN+Apache


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、创建管理用户

[root@localhost ~]# groupadd benet

[root@localhost ~]# useradd -d /opt/benet -g benet benet

[root@localhost ~]# echo "benet" | passwd --stdin benet


3、创建软件包目录soft、安装目录app、库文件目录applib

[root@localhost ~]# cd /opt/

[root@localhost opt]# mkdir soft

[root@localhost opt]# mkdir applib

[root@localhost opt]# mkdir app


4、安装httpd

[root@localhost soft]# tar xf httpd-2.2.29.tar.gz 

[root@localhost soft]# cd httpd-2.2.29

[root@localhost httpd-2.2.29]# ./configure --prefix=/opt/app/apache --enable-dav --enable-so --enable-modules=most

[root@localhost httpd-2.2.29]# make

[root@localhost httpd-2.2.29]# make install

5、安装apr

[root@localhost soft]# tar xf apr-1.5.2.tar.gz 

[root@localhost soft]# cd apr-1.5.2

[root@localhost apr-1.5.2]# ./buildconf  ## ./buildconf   #验证系统是否已经安装pythonautoconflibtool,如果没有安装,使用yumrpm方式安装相应包即可。

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

[root@localhost apr-1.5.2]# ./configure --prefix=/opt/app/apr --libdir=/opt/applib/

[root@localhost apr-1.5.2]# make

[root@localhost apr-1.5.2]# make install

6、安装apr-util

[root@localhost soft]# tar xf apr-util-1.5.4.tar.gz 

[root@localhost soft]# cd apr-util-1.5.4

[root@localhost apr-util-1.5.4]# ./configure --prefix=/opt/app/apr-util --with-apr=/opt/app/apr

[root@localhost apr-util-1.5.4]# make

[root@localhost apr-util-1.5.4]# make install

[root@localhost ~]# echo "/opt/applib/" >> /etc/ld.so.conf.d/applib.conf  ##由于安装apr是指定了库文件位置为/opt/applib所以需要添加到共享库中否则启动Apache是会找不到apr

[root@localhost ~]# ldconfig 



7、安装sqlite

[root@localhost soft]# tar xf sqlite-autoconf-3071700.tar.gz 

[root@localhost soft]# cd sqlite-autoconf-3071700

[root@localhost sqlite-autoconf-3071700]# ./configure --prefix=/opt/app/sqlite

[root@localhost sqlite-autoconf-3071700]# make

[root@localhost sqlite-autoconf-3071700]# make install

8、安装subversion

[root@localhost soft]# tar xf subversion-1.8.13.tar.gz 

[root@localhost soft]# cd subversion-1.8.13

[root@localhost 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

[root@localhost subversion-1.8.13]# make

[root@localhost subversion-1.8.13]# make install


9、创建SVN仓库

[root@localhost ~]# mkdir /opt/svnroot/oa -p  #创建svn数据库目录

[root@localhost ~]# chmod -R 777 /opt/  #为了测试方便赋予/opt目录777权限

[root@localhost ~]# /opt/app/subversion/bin/svnadmin create /opt/svnroot/oa/test #使用svnadmin create 创建一个名为test的库

10、创建权限配置文件

[root@localhost ~]# vi /opt/svnroot/oa/authz.conf #添加如下内容

[/]  

* = r   ##表示对所有用户开放的权限

[test:/] 

wangenzhi = rw   ##表示对wangenzhi这个用户开放的权限


11、创建用户认证文件

[root@localhost ~]# /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目录下

[root@localhost ~]# cd /opt/app/subversion/libexec/

[root@localhost libexec]# ls

mod_authz_svn.so  mod_dav_svn.so

[root@localhost ~]# cp /opt/app/subversion/libexec/* /opt/app/apache/modules/


13、编辑Apache配置文件

[root@localhost ~]# cp /opt/app/apache/conf/httpd.conf /opt/app/apache/conf/httpd.conf.bak #做任何操作之前先将配置文件备份一份

[root@localhost ~]# 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

[root@localhost ~]# /opt/app/apache/bin/apachectl start

[root@localhost ~]# service iptables stop ##为了测试将防火墙关掉

15、使用SVN客户端测试

wKiom1VmnkDQy4g1AAUWiUabwgI455.jpgwKioL1VmoA-D0PfoAAFgRJu90pc871.jpg

16、使用Windows下的TortoiseSVN客户端chkout 下载操作,Windows下安装TortoiseSVN这里不再演示按照默认下一步安装即可。下载TortoiseSVN,百度TortoiseSVN即可

wKioL1VmpmnSY3diAAKWkBNkSKA906.jpg

wKiom1VmpNfyYsyYAAE0qrKAIu4223.jpg

wKioL1VmpmmQiYPSAAZ84Hwq2MI470.jpg

wKiom1VmpNehIoUPAAMKWXMFO9o874.jpg

######################至此安装结束,写的不好请大家多多指点。谢谢###########################


你可能感兴趣的:(centos6.5,源码搭建SVN+Apache)