Apache+subversion without ssl
1.下载Subversion及其依赖软件
apr-1.5.0.tar.gz
apr-util-1.5.3.tar.gz
httpd-2.4.7.tar.gz
libtool-2.4.2.tar.gz
pcre-8.34.tar.gz
sqlite-autoconf-3080301.tar.gz
subversion-1.8.5.tar.gz
zlib-1.2.8.tar.gz
2.安装编译相关包
yum install gcc gcc-c++
也可以手动安装
rpm -ivh mpfr-2.4.1-6.el6.x86_64.rpm
rpm -ivh ppl-0.10.2-11.el6.x86_64.rpm
rpm -ivh cpp-4.4.7-4.el6.x86_64.rpm
rpm -ivh cloog-ppl-0.15.7-1.2.el6.x86_64.rpm
rpm -ivh libstdc++-devel-4.4.7-4.el6.x86_64.rpm
rpm -ivh gcc-4.4.7-4.el6.x86_64.rpm
rpm -ivh gcc-c++-4.4.7-4.el6.x86_64.rpm
3.解压并编译Subversion及其依赖软件步骤
1)解压软件包
tar -zxvf apr-1.5.0.tar.gz
tar -zxvf apr-util-1.5.3.tar.gz
tar -zxvf httpd-2.4.7.tar.gz
tar -zxvf libtool-2.4.2.tar.gz
tar -zxvf pcre-8.34.tar.gz
tar -zxvf sqlite-autoconf-3080301.tar.gz
tar -zxvf subversion-1.8.5.tar.gz
tar -zxvf zlib-1.2.8.tar.gz
2)编译并安装 apr-1.5.0
cd apr-1.5.0
./configure--prefix=/usr/local/apr
make
make install
3)编译并安装libtool-2.4.2
cd libtool-2.4.2
./configure --prefix=/usr/local/libtool
make
make install
4)编译并安装apr-util-1.5.3
cd apr-util-1.5.3
./configure --prefix=/usr/local/apr-util--with-apr=/usr/local/apr/bin/apr-1-config
make
make install
5)编译并安装pcre-8.34
cd pcre-8.34
./configure --prefix=/usr/local/pcre
make
make install
6)编译并安装 httpd-2.4.7
cd httpd-2.4.7
./configure --prefix=/usr/local/apache --enable-so --enable-dav--enable-dav-fs --enable-mnaintainet-mode --with-apr=/usr/local/apr--with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre
make
make install
7)编译并安装 zlib-1.2.8
cd zlib-1.2.8
./configure --prefix=/usr/local/zlib
make
make install
8)编译并安装 qlite-autoconf-3080301
cd sqlite-autoconf-3080301
./configure --prefix=/usr/local/sqlite
make
make install
9)编译并安装subversion-1.8.5.tar.gz
cd subversion-1.8.5
./configure --prefix=/usr/local/subversion--with-apxs=/usr/local/apache/bin/apxs --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util--with-sqlite=/usr/local/sqlite --enable-maintainer-mode--with-zlib=/usr/local/zlib
make
make install
4.配置环境变量
vi /etc/profile#root权限修正
添加如下内容
PATH=/usr/local/apache/bin:$PATH
PATH=/usr/local/subversion/bin:$PATH
5.配置Apache
1)复制apache需要加载的modules
cp /usr/local/subversion/libexec/*/usr/local/apache/modules/
2)编辑apache配置文件httpd.conf
vi/usr/local/apache/conf/httpd.conf
修改内容:
<IfModule unixd_module>
#
# If you wish httpd to run as a different user or group, you mustrun
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpdas.
# It is usually good practice to create a dedicated user and groupfor
# running httpd, as with most system services.
#
Userdaemon#修改为subversion的owner
Groupdaemon#修改为subversion的group
</IfModule>
# LoadModuledav_module modules/mod_dav.so#去掉前面的”#”
添加内容:
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
<Location /svn/>
DAV svn
SVNParentPath /usr/local/subversion/svn
AuthType Basic
AuthName "Subversion repository"
AuthUserFile/usr/local/subversion/auth.conf#用户名及密码
Require valid-user
AuthzSVNAccessFile /usr/local/subversion/access.conf#用户权限文件
</Location>
6.subversion配置
1)创建svn库
mkdir /usr/local/subversion/svn
svnadmin create /usr/local/subversion/svn/repos
2)增加用户并设置密码
htpasswd -c /usr/local/subversion/auth.conf test1
htpasswd /usr/local/subversion/auth.conf test2
注意:首次创建用户使用-c参数,以后添加用户不能使用否则以前的文件将被覆盖
3)设置SVN用户访问目录的权限
touch/usr/local/subversion/access.conf
vi /usr/local/subversion/access.conf
添加如下内容
[repos:/]
test1 = rw
test2 = rw
4)修改svnserve配置文件
vi /usr/local/subversion/svn/repos/conf/svnserve.conf
修改内容如下:
anon-access = read
auth-access = write
password-db = /usr/local/subversion/auth.conf
authz-db = /usr/local/subversion/access.conf
5)设置repos用户权限
root用户下配置如下,如果其他用户下配置请将权限赋予该用户
chown -R daemon /usr/local/subversion/svn/repos
7.将防火墙关闭
service iptables stop
8.http访问svn
http://ipaddress/svn/repos