linux svn域账号认证
操作系统: centos 5.5 i386 需要软件包:openldap-2.3.43-25.el5mysql-5.0.45.tar.gzphp-5.2.4.tar.gzhttpd-2.2.6.tar.gzsubversion-1.7.1.tar.gz1.安装openldap#yum install openldap# rpm -qa openldap*openldap-2.3.43-25.el52、安装mysql#groupadd mysql#useradd -g mysql -s /bin/false -M mysql#tar zxvf mysql-5.0.45.tar.gz#cd mysql-5.0.45#./configure --prefix=/usr/local/mysql --enable-thread-safe-client --enable-local-infile --with-charset=utf8 --with-extra-charset=all --with-low-memory #make && make install#cp support-files/my-medium.cnf /etc/my.cnf#cd /usr/local/mysql#chown -R mysql .#chgrp -R mysql .#bin/mysql_install_db --user=mysql#chown -R root .#chown -R mysql var #bin/mysqld_safe --user=mysql &#cd /mysql-5.0.45#cp support-files/mysql.server /etc/rc.d/init.d/mysqld#chmod 700 /etc/rc.d/init.d/mysqld加入自动启动服务队列:#chkconfig --add mysqld#chkconfig --level 345 mysqld on添加root密码#/usr/local/mysql/bin/mysqladmin -uroot -p 旧密码 password 新密码说明:此时mysql的root用户的密码为空配置库文件搜索路径# echo "/usr/local/mysql/lib/mysql" >> /etc/ld.so.conf# ldconfig -v添加/usr/local/mysql/bin到环境变量PATH中#export PATH=$PATH:/usr/local/mysql/bin3.安装、配置httpdsvn需要加载 --enable-dav --enable-dav-fsldap需要加载 --enable-ldap --enable-authnz-ldap# useradd apache#tar zxvf httpd-2.2.6.tar.gz#cd httpd-2.2.6#./configure --prefix=/usr/local/apache2 --enable-so --enable-mods-shared=most --enable-dav --enable-dav-fs --enable-rewrite --enable-ssl --enable-ldap --enable-authnz-ldap --with-included-apr --with-ldap --with-ldap-include=/usr/lib/evolution-openldap/include--with-ldap-lib=/usr/lib#make && make install#echo "/usr/local/apache/bin/apachectl start" >> /etc/rc.local(系统启动时服务自动启动)更改apache配置文件#vim /usr/local/apache2/http.conf添加User apacheGroup apacheLoadModule authnz_ldap_module modules/mod_authnz_ldap.soLoadModule ldap_module modules/mod_ldap.so4.安装php#yum install libpng-devel#yum install libjpeg-devel# tar -zvxf php-5.2.3.tar.gz# mkdir -p /usr/local/php# cd php-5.2.3#./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-libdir=lib64 --with-png-dir=/usr/lib64/libpng.so --with-jpeg-dir=/usr/lib64/libjpeg.so --with-zlib --with-gd --with-freetype --enable-mbstring=all# make/php-5.2.3/ext/mysqli/mysqli_api.c:603: error: 'gptr' undeclared (first use in this function)
make: *** [mysqli_api.lo] 错误 1
查找mysqli_api.c所有gptr,有四处分别位于行144、行150、行603、行607,以 char* 替换
#make install
# cp php.ini-dist /usr/local/php/lib/php.ini #vim /usr/local/apache/conf/httpd.conf 添加 LoadModule php5_module modules/libphp5.so AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps DirectoryIndex index.php index.html5.安装subversion#mkdir /usr/local/svn #tar zxvf subversion-1.7.1.tar.gz#cd subversion-1.7.1# ./configure --prefix=/usr/local/svn --with-apxs=/usr/local/apache2/bin/apxs --with-apr=/usr/local/apache2/bin/apr-1-config --with-apr-util=/usr/local/apache2/bin/apu-1-config# make && make install更改apache配置#vim /usr/local/apache/conf/httpd.conf添加LoadModule dav_svn_module modules/mod_dav_svn.soLoadModule authz_svn_module modules/mod_authz_svn.so6、配置svn#mkdir -p /data/svn/svn#mkdir -p /data/svn/svn_auth#/usr/local/apache2/bin/htpasswd -b /data/svn/svn_ahth/passwd test1 test #新建用户test1 密码为test#touch /data/svn/svn_ahth/auth.conf #创建svn配置文件#svn admin create /data/svn/svn/mysvn #建立svn配置mysvn#chown apache.apache /data/svn/svn/mysvn -R #更改svn库权限#vim /data/svn/svn_ahth/auth.conf #为用户test1增加访问权限[mysvn:/]test1 = rw#vim /usr/local/apache/conf/httpd.conf若需要本地认证,配置如下<Location /svn_local>DAV svnSVNParentPath /data/svn/svn #svn库存放路径AuthType BasicAuthName "Welcome to svn"AuthUserFile /data/svn/svn_auth/passwd #svn用户名、密码AuthzSVNAccessFile /data/svn/svn_auth/auth.conf #svn权限配置文件Require valid-user</Location>#/usr/local/apache2/bin/apachectl restart在浏览器访问mysvn库http://svn.test.com/svn_local/mysvn如需要ldap(域账号)认证,配置如下:#svn ldap认证缓存LDAPSharedCacheSize 200000LDAPCacheEntries 1024LDAPCacheTTL 600LDAPOpCacheEntries 1024LDAPOpCacheTTL 600<Location /svn_ldap>DAV svnSVNParentPath /data/svn/svnAuthzSVNAccessFile /data/svn/svn_auth/auth.conf# authenticationAuthType BasicAuthName "ldap svn"AuthBasicProvider ldap #ldap认证AuthLDAPBindDN "cn=admin,ou=Admin,dc=test,dc=com" #绑定ldap认证用户 AuthLDAPBindPassword 123456 #绑定ldap认证用户密码AuthLDAPURL "ldap://10.10.1.13:389/ou=Users,dc=test,dc=com?sAMAccountName?sub?(objectClass=*)" Allow from Allrequire valid-user</Location>在域控ou “Users”添加用户test2通过浏览器访问mysvn库测试http://svn.test.com/svn_ldap/mysvn参考文档http://81236880.blog.51cto.com/3301633/605198http://bbs.iusesvn.com/viewthread.php?tid=2134&extra=page%3D1%26amp%3Bfilter%3Ddigesthttp://apache.jz123.cn/mod/mod_authnz_ldap.html