apache+php+subversion 安装

来源:互联网 发布:贵阳数据博览会 编辑:程序博客网 时间:2024/06/07 05:57


1.apache http server安装
    ./configure --enable-so --enable-mods-shared=all --enable-ldap --enable-authnz-ldap  --with-included-apr
    ./configure --enable-so --enable-mods-shared=all --enable-ldap --enable-authnz-ldap  --with-included-apr --with-ldap=ldap

    make
    make install
    
说明:
   1.--with-included-apr 使用源代码自带的apr库
   2.使用 --enable-ldap 和 --enable-authnz-ldap的时候还要有 --with-ldap=ldap选项
   3.--enable-mods-shared=all并不是真正的包括所有的模块,我这里的ldap模块就没包含在all里面,还要单独使用with参数编译这些模块
详细情况参考官方安装文档。

2.php 安装

 ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --prefix=/usr/local/php5
 make
 make install
 
3.subversion 安装
    
    export LD_LIBRARY_PATH=/usr/local/BerkeleyDB.4.4/lib:$LD_LIBRARY_PATH
    ./configure --prefix=/usr/local/subversion --with-neon=/usr --with-ssl --with-apxs=/usr/local/apache2/bin/apxs  --with-sqlite=/usr/local/sqlite-3.6.13/  --with-berkeley-db=db.h:/usr/local/BerkeleyDB.4.4/include/:/usr/local/BerkeleyDB.4.4/lib:db


说明:
   --with-neon参数必须设置,如果你想通过http这种方式访问svn代码库,否则 运行svn info http://svn-host/repo 这种命令会出现 not a valid url错误
   
   如果碰到后面这个错误  configure: error: Berkeley DB 4.0.14 or newer wasn't found.
   原因有2点:
         1.  LD_LIBRARY_PATH变量设置中没有包括 BerkeleyDB的lib文件的存放路径,运行时碰到这个问题也可以通过设置环境变量来解决。
         2.  ./configure 时候指定的--with-berkeley-db不对,指定该参数的格式为--with-berkeley-db=[HEADER:INCLUDES:LIB_SEARCH_DIRS:LIBS]
             HEADER:为Berkeley DB 的头文件名,即为db.h
             INCLUDES:为Berkeley DB头文件存放的路径,我这里为/usr/local/BerkeleyDB.4.4/include/
             LIB_SEARCH_DIRS:为Berkeley DB库文件(libdb.so)存放路径,我这里为/usr/local/BerkeleyDB.4.4/lib
             LIBS:为库文件的名字,我这里为db,对应库文件libdb.so.
             
4.修改apache配置文件

    DocumentRoot "/var/www/html"
    
    
    <Directory "/var/www/html">
    
    DirectoryIndex index.html index.php
    
    <FilesMatch \.php$>
        SetHandler application/x-httpd-php
    </FilesMatch>
           
    <Location /repos>
       DAV svn
       SVNParentPath /var/www/svn    
       #使用svn认证,属于svn-users组的成员允许访问,详细的权限由access-file控制
       AuthType Basic
       AuthName "Authorization Realm"
       AuthBasicProvider ldap
       AuthLDAPBindDN "cn=admin,dc=foreveross,dc=com"
       AuthLDAPBindPassword secret
       AuthLDAPURL ldap://localhost/ou=user,dc=foreveross,dc=com?cn
       AuthLDAPGroupAttributeIsDN on
       Require ldap-group cn=svn-users,ou=group,dc=foreveross,dc=com

    </Location>



机器上软件环境:
        OS:Red Hat Enterprise Linux Server release 5 (Tikanga) 32Bit
    Mysql:  mysql-devel-5.0.22-2.1.0.1 、mysql-5.0.22-2.1.0.1
    BerkeleyDB:/usr/local/BerkeleyDB.4.4/
        sqlite:/usr/local/sqlite-3.6.13/
        openldap:openldap-2.3.27-5
        apache( httpd-2.2.22): /usr/local/apache2
        php(php-5.3.10):/usr/local/php5
        subversion(subversion-1.6.17):/usr/local/subversion
        
        

原创粉丝点击