1. 程式人生 > >svn+http+ad域

svn+http+ad域

con res 服務 logs 麻煩 mkdir -p httpd-2.4 文件的 red

svn本地添加用戶太麻煩了,如果公司有一百個開發人員要訪問,要創建賬號密碼太麻煩了;所以讓他們用AD域賬號去登錄就很方便,但是權限的管控還是在svn的本地添加(這個暫時還沒辦法很好的解決)

一、安裝依賴包和模塊包

  1、域環境已經配置好的,域名example.com

  2、安裝本地依賴包和第三方包:

  • #yum -y install openssl perl perl* pcre zlib tree gcc gcc-c++ make libtool pcre-devel lrzsz zlib-devel openssl-devel neon openldap-devel
  • 安裝apr

   # tar zvxf apr-1.5.2.tar.gz

   #cd apr-1.5.2

   #./configure --prefix=/usr/local/apr

   #make && make install

  • 安裝apr-util

   #tar zxvf apr-util-1.5.4.tar.gz

   #cd apr-util-1.5.4

   #./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr

   #make && make install

   #/usr/local/apr-util/bin/apu-1-config --version 檢測apr-util是否安裝成功

  • 安裝pcre

   #tar zxvf pcre-8.35.tar.gz

   #cd pcre-8.35

   #./configure --prefix=/usr/local/pcre

   #make && make install

  • 安裝openssl

   #tar zvxf openssl-1.0.2c.tar.gz
   #cd openssl-1.0.2c
   #./config --prefix=/usr/local/openssl
   #make && make install

  • 安裝sqlite

   #tar zvxf sqlite-autoconf-3080500.tar.gz
   #cd sqlite-autoconf-3080500
   #./config
   #make && make install

  • 安裝dap

   #tar zvxf dap-3.9.tar.gz
   #cd dap-3.9.tar.gz
   #./configure

   #make && make install

  • 安裝libtool

   #tar zvxf libtool libtool-2.4.6.tar.gz
   #cd libtool-2.4.6
   #./configure

   #make && make install

二、安裝http

  #tar zvxf httpd-2.4.6.tar.gz
  #cp -rf ./apr-1.5.2 ./httpd-2.4.6/srclib/apr
  #cp -rf ./apr-util-1.5.4 ./httpd-2.4.6/srclib/apr-util 需要apr和apr-utils並解壓到 ./srclib/ 目錄下, 再進行編譯。
  #cd httpd-2.4.6
  #./configure --prefix=/usr/local/apache --enable-ldap=shared --enable-authnz-ldap=sahred --with-included-apr --with-ldap --with-apr --with-apr-util --enable-so --enable-dav --enable-rewrite=shared --enable-ssl=shared --enable-deflate=shared --enable-authn-dbm=shared --enable-authn-anon=shared --enable-auth-basic=shared --with-mpm=prefork --enable-cache --enable-file-cache --enable-mem-cache --enable-disk-cache
  ./configure --prefix=/usr/local/apache --enable-ldap --enable-authnz-ldap --with-included-apr --with-ldap --with-apr --with-apr-util --enable-so --enable-dav --enable-rewrite --enable-ssl --enable-deflate=shared --enable-authn-dbm --enable-authn-anon --enable-auth-basic --with-mpm=prefork --enable-cache --enable-file-cache --enable-mem-cache --enable-disk-cache

  #make && make install

   #ln -s /usr/local/apache /etc/httpd

   #rmdir /etc/httpd/logs

   #mkdir /var/log/httpd

   #ln -s /var/log/httpd /etc/httpd/logs

   #rm /etc/rc.d/init.d/http

   #cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd

   #/etc/init.d/httpd start

   #netstat -ntlp | grep httpd 查看http的端口是否開啟

   技術分享

三、安裝svn

  #tar zvxf subversion-1.8.13.tar.gz
  #cd subversion-1.8.10
  # ./configure --prefix=/usr/local/subversion --with-apxs=/usr/local/apache/bin/apxs --with-apr=/usr/local/apache --with-apr-util=/usr/local/apache --with-zlib

  #make && make install

  #cd ~
  #vim .bash_profile
  #PATH=$PATH:$HOME/bin:/usr/local/subversion/bin
#source .bash_profile

  #mkdir -p /var/www/svn

  #svnadmin create /var/www/svn/repo1 

  #chown -R apache:apache /var/www/svn/repo1 增加一個站點

  技術分享

  #vim /var/www/svn/repo1/conf/svnserve.conf 修改4個點

  技術分享

  #vim /var/www/svn/repo1/conf/passwd 添加兩個用戶密碼

  技術分享

  #vim /var/www/svn/repo1/conf/authz 設置權限

  技術分享

  #svnserve -d -r /var/www/svn/repo1

  #ps aux | grep svn 查看是否正常啟動

  技術分享

  可以用svn客戶端測試一下:

  技術分享

四、http和svn的合用

  #cp /usr/local/subvesion/libexec/mod_authz_svn.so /usr/local/apache/modules/mod_authz_svn.so

  #cp /usr/local/subvesion/libexec/mod_dav_svn.so /usr/local/apache/modules/mod_dav_svn.so

  #vim /etc/httpd/conf/httpd.conf 添加修改以下項

  技術分享

  #svnadmin create /var/www/svn/svntest

  #cp /var/www/svn/svntest/conf/authz /var/www/svn/

  #touch /var/www/svn/passwd

  #htpasswd /var/www/svn/passwd svntest

  #htpasswd /var/www/svn/passwd svnuser web登錄密碼設置

  技術分享

  #vim /var/www/svn/authz 權限設置

  技術分享

  #chown -R apache:apache /var/www/svn/svntest

  #vim /etc/httpd/conf/httpd.conf http配置文件添加訪問svn站點

  技術分享

  登錄網頁測試一下 http://ip/svntest/svntest 第一個svntest是http配置文件的Location後面那個/svntest;第二個svntest才是svn服務器在本地create的站點

  技術分享

五、http、svn和AD域的合用

  #cat /etc/hosts

  技術分享

  #cat /etc/resolv.conf

  技術分享

  #vim /etc/httpd/conf/httpd.conf

  技術分享

  技術分享

  在域服務器上添加ou及用戶

  技術分享

  登錄網頁測試一下 http://ip/svntest/svntest ok啦!

  

svn+http+ad域