SVN+Apache+LDAP

1.安裝ldap
wget http://download.oracle.com/berkeley-db/db-4.8.30.tar.gz
tar zxvf db-4.8.30.tar.gz
cd db-4.8.30/build_unix/
../dist/configure --prefix=/usr/local/BerkeleyDB
make && make install && cd ../../
echo "/usr/local/BerkeleyDB/lib" >> /etc/ld.so.conf
ldconfig



wget ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/openldap-2.4.35.tgzweb

tar zxvf openldap-2.4.35.tgz
cd openldap-2.4.35
LDFLAGS="-L/usr/local/BerkeleyDB/lib/" CPPFLAGS="-I/usr/local/BerkeleyDB/include" ./configure --prefix=/usr/local/openldap --enable-static --enable-shared
make depend
make && make install && cd .



2.安裝opensslsql

#wget http://www.openssl.org/source/openssl-1.0.1.tar.gz
# tar xzvf openssl-1.0.1.tar.gz
# cd openssl-1.0.1
# ./config -fPIC --prefix=/usr/local/openssl/ enable-shared (必定須要加上-fPIC參數,不然編譯安裝serf會報錯)
# make && make install
3.安裝http
tar zxvf httpd-2.2.24.tar.gz


安裝apr:apache

cd httpd-2.2.24/srclib/apr/
./configure --prefix=/usr/local/apr && make && make install


安裝apr-util:vim

cd ../apr-util/
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/ \
--with-berkeley-db=/usr/local/BerkeleyDB/  --with-ldap-include=/usr/local/openldap/include/ \
--with-ldap-lib=/usr/local/openldap/lib  --with-ldap  --with-openssl=/usr/local/openssl
make && make install


安裝http:瀏覽器

cd    ../../
LDFLAGS=-ldl ./configure --prefix=/usr/local/httpd2 --with-apr=/usr/local/apr/bin/apr-1-config \
--with-apr-util=/usr/local/apr-util/bin/apu-1-config --enable-authnz-ldap \
--enable-ldap  --enable-mods-shared=all --enable-modules=all  --enable-ssl  \

--with-ssl=/usr/local/openssl/ --enable-so --enable-dav --enable-maintainer-mode --enable-rewrite
oracle

http安裝完成,啓動http:/usr/lcoal/httpd2/bin/apachectl startide

瀏覽器登陸:svn


4.安裝svn:
wget ftp://ftp.gnu.org/gnu/libiconv/libiconv-1.14.tar.gz
tar zxvf libiconv-1.14.tar.gz
cd libiconv-1.14
./configure --prefix=/usr/local/libiconv
make && make install && cd ..
echo "/usr/local/libiconv/lib" >> /etc/ld.so.conf

ldconfig測試



tar zxvf neon-0.29.6.tar.gz
cd neon-0.29.6
yum install libxml2 libxml2-devel expat expat-devel

./configure --prefix=/usr/local/neon && make && make install && cd ..ui



wget http://serf.googlecode.com/files/serf-1.0.0.tar.bz2
tar jxvf serf-1.0.0.tar.bz2
cd serf-1.0.0
./configure --prefix=/usr/local/serf --with-apr-util=/usr/local/apr-util/ --with-openssl=/usr/local/openssl/

make && make install && cd ..


tar -xvf subversion-1.7.8.tar.gz
tar zxvf sqlite-amalgamation-3.7.3.tar.gz
mkdir subversion-1.7.8/sqlite-amalgamation
cp sqlite-3.7.3/sqlite3.c subversion-1.7.8/sqlite-amalgamation
cd sqlite-3.7.3
./configure --prefix=/usr/local/sqlite3
make && make install && cd ../
echo "/usr/local/sqlite3/lib" >> /etc/ld.so.conf
ldconfig


cd ../subversion-1.7.8
LD_LIBRARY_PATH=/usr/local/BerkeleyDB/lib/ \
CPPFLAGS="-I/usr/local/BerkeleyDB/include" \
LDFLAGS="-L/usr/local/BerkeleyDB/lib" \
./configure --prefix=/usr/local/svn \
--with-berkeley-db=db.h:/usr/local/BerkeleyDB/include:/usr/local/BerkeleyDB/lib:db-4.8 \
--with-apxs=/usr/local/httpd2/bin/apxs \
--with-apr=/usr/local/apr/bin/apr-1-config \
--with-apr-util=/usr/local/apr-util/bin/apu-1-config \
--with-serf=/usr/local/serf \
--with-neon=/usr/local/neon/lib \
--with-ssl \
--with-zlib=/usr/lib \
--enable-maintainer-mode
make && make install
cd
echo 'PATH=/usr/local/svn/bin:$PATH' >> /etc/profile
echo 'export SVN_EDITOR=vim' >> /etc/profile
source /etc/profile
測試SVN安裝是否成功:svn  --version

5.SVN經過LDAP認證,實現windwos AD中用戶登陸:

(1)SVN版本庫建立:

創建svn版本庫存放的根目錄:mkdir  -p /opt/svndata/

創建svn版本庫test:svnadmin create /opt/svndata/test

賦予權限:chown -R daemon:daemon /opt/svndata/test  //daemon用戶和組是http配置文件中默認的,用來經過http登陸svn,能夠根據須要進行修改。

啓動svn服務:
svnserver -d -r /opt/svndata  

netstat -nltp |grep 3690  //svn默認啓動端口

(2

vim  /usr/local/openldap/etc/openldap/ldap.conf

添加  REFERRALS off

echo "LoadModule dav_svn_module     modules/mod_dav_svn.so" >> /usr/local/httpd2/conf/httpd.conf
echo "LoadModule authz_svn_module modules/mod_authz_svn.so" >> /uar/lcoal/httpd2/conf/httpd.conf
vim /usr/local/httpd/conf/httpd.conf
將Include conf/extra/httpd-vhosts.conf前的#註釋掉


添加虛擬主機

vim  /usr/local/httpd/conf/extra/httpd-vhosts.conf

6.SVN測試:

添加登陸用戶,並設置權限,vim /opt/svndata/authz


SVN客戶端測試:http://192.168.0.223/svndata/test

瀏覽器登陸:

點擊登陸便可,出現以下說明登陸成功:

相關文章
相關標籤/搜索
本站公眾號
   歡迎關注本站公眾號,獲取更多信息