Asianux Server 3 安装Apache + svn(subversion)

来源:岁月联盟 编辑:exp 时间:2012-02-09
1、准备工作
 
        下载组件httpd-2.2.12.tar.bz2,apr-1.3.6.tar.gz,apr-util-1.3.8.tar.gz,sqlite-3.6.19.tar.gz,subversion-1.6.5.tar.bz2
 
         注意:组件之间的版本有要求,如果安装失败,尝试一下其它版本,以上版本已测试安装成功。
 
2、安装Apache
 
       tar zvxf apr-1.3.6.tar.gz
 
       ./configure --prefix=/usr/local/apr
 
       make && make install
 
 
 
       tar zvxf apr-util-1.3.8.tar.gz
 
       ./configure --prefix=/usr/local/apr-util
 
       make && make install
 
 
 
       tar zvxf sqlite-3.6.19.tar.gz
 
       ./configure --prefix=/usr/local/sqlite
 
       make && make install
 
       tar jvxf httpd-2.2.12.tar.bz2
 
       ./configure --prefix=/usr/local/apache2/ --enable-dav --enable-so --enable-modules=most --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/
 
       make && make install
 
      (注意必须要有参数--enable-dav --enable-so)
 
 
 
       安装apache完成,执行# /usr/local/apache/bin/apachectl start
 
       启动apache
 
 
 
3、安装svn(subversion)
 
       注意:检查之前是否已经安装svn,若已安装,则卸载
 
       # yum erase subversion
 
 
 
       tar jvxf subversion-1.6.5.tar.bz2
 
       注意:复制之前解压的sqlite到当前subversion-1.6.5源码目录下,否则可能会出现undefined symbol: sqlite_open_v2错误.
 
       mv sqlite-3.6.19 subversion-1.6.5/sqlite-amalgamation
 
 
      ./configure --prefix=/usr/local/svn --with-apxs=/usr/local/apache2/bin/apxs --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-ssl --enable-maintainer-mode
 
       make && make install
 
     
 
        查看/usr/local/apache/conf/httpd.conf,两个动态库是否已经成功安装
 
        如发现以下两个模块,说明安装成功
 
        LoadModule dav_svn_module     modules/mod_dav_svn.so
        LoadModule authz_svn_module   modules/mod_authz_svn.so
4、配置SVN
 
      编辑/usr/local/apache/conf/httpd.conf
 
      添加:
 
      Group svnadmin   
 
      User svnadmin    
 
      <Location /svn>
             DAV svn
             SVNParentPath /svn
             AuthType Basic
             AuthName "svn repository"
              AuthUserFile /etc/svn-auth-file
             AuthzSVNAccessFile /etc/svn-access-file
             Require valid-user
      </Location>
 
       新建SVN账户和访问控制文件
 
       groupadd svnadmin
 
       useradd -g svnadmin svnadmin
 
 
 
       htpasswd -cm  /etc/svn-auth-file admin 创建第一个用户
 
       htpasswd -m /etc/svn-auth-file dev
 
       htpasswd -m /etc/svn-auth-file test
 
      ...
 
       编辑/etc/svn-access-file
 
       [groups]
 
            admin = admin
 
             devs = dev, test
 
       [/]
 
             @admin = rw
 
             @devs = r
 
       [myrepos:/]
 
              @devs = rw
 
 
 
       新建版本库myrepos
 
       svnadmin create /svn/myrepos
 
 
 
       chown -R svnadmin.svnadmin /svn
 
 
 
        测试:使用url访问myrepos版本库
 
        http://www.2cto.com /myrepos
 
        输入账户密码后,登录成功
摘自 xabc3000的专栏