svn+http+ad域

來源:互聯網
上載者:User

標籤:gcc   blank   net   bash   str   帳號   hosts   c++   ad域   

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域

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.