CentOS5.5上编译安装Apache2.2.17+Subversion1.65

1、下载源代码包
http://mirror.bjtu.edu.cn/apache//apr/apr-1.4.2.tar.gz
http://mirror.bjtu.edu.cn/apache//apr/apr-util-1.3.10.tar.gz
http://subversion.tigris.org/downloads/subversion-1.6.15.tar.gz
http://subversion.tigris.org/downloads/subversion-deps-1.6.15.tar.gz
http://mirror.bjtu.edu.cn/apache//httpd/httpd-2.2.17.tar.gz

2、安装基本环境
1).

yum -y install gcc openssl-devel expat-devel openssl-devel libxml2-devel
3、编译安装
1).安装apr

tar zxvf apr-1.4.2.tar.gz
cd apr-1.4.2
./configure
make
make install

2).安装apr-util
tar zxvf apr-util-1.3.10.tar.gz
cd apr-util-1.3.10
./configure –with-apr=/usr/local/apr
make
make install

3).安装 apache
tar zxvf httpd-2.2.17.tar.gz
cd httpd-2.2.17
./configure –prefix=/usr/local/apache2.2.17 –enable-dav \
–enable-so –enable-maintainer-mode \
–with-apr=/usr/local/apr/bin/apr-1-config \
–with-apr-util=/usr/local/apr/bin/apu-1-config
make
make install

4).安装subversion
tar zxvf subversion-1.6.15.tar.gz
tar zxvf subversion-deps-1.6.15.tar.gz
cd subversion-1.6.15
./configure –prefix=/opt/svn \
–with-apxs=/usr/local/apache2.2.17/bin/apxs \
–with-apr=/usr/local/apr \
–with-apr-util=/usr/local/apr \
–without-berkeley-db
make
make install

4、配置apache,启用SVN
cat /usr/local/apache2.2.17/conf/httpd.conf | grep svn
显示
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
就表明安装成功。
vi /usr/local/apache2.2.17/conf/httpd.conf
定义apache访问svn配置,添加如下几行:

DAV svn
# SVNPath /opt/repository #单一版本库
SVNParentPath /opt/repositories #多个版本库
AuthzSVNAccessFile /opt/svn/conf/authz.conf
AuthType Basic
AuthName “Subversion repository”
AuthUserFile /opt/svn/conf/passwd.conf
Require valid-user
5、配置svn

1).建立svn版本库目录
mkdir -pv /opt/repositories/repos
chown -Rv daemon /opt/repositories
chmod -Rv 755 /opt/repositories

2).建立svn版本库
svnadmin create –fs-type fsfs /opt/repositories/repos

3).建立访问控制文件
/usr/local/apache2.2.17/bin/htpasswd -c /opt/svn/conf/passwd.conf myname
然后输入密码,默认为MD5加密
/usr/local/apache2.2.17/bin/htpasswd /opt/svn/conf/passwd.conf otherusername #添加其他用户

4).建立本地项目控制文件
cat > authz.conf << EOF
[groups]
#=,
admin=myname

#[:project/directory]
#@=
#=

[/]
@admin = rw #指定用户组成员可以读写根目录所有应用

[repos:/path/subpath]
otherusername= rw #otherusername:/path/subpath目录的文件
EOF
5、测试
启动apache
/usr/local/apache2.2.17/bin/apachectl start
http://centos-ip-or-domain/svn/repos

Post a Comment

Your email is never shared. Required fields are marked *

*
*