tar xfj httpd-2.2.4.tar.bz2 cd httpd-2.2.4 ./buildconf ./configure --enable-dav --enable-so make make install三、安裝Subversion
tar xfj subversion-1.4.3.tar.bz2 tar xfj subversion-deps-1.4.3.tar.bz2 # subversion-deps的文件也會解壓到subversion-1.4.3目錄中 cd subversion-1.4.3 rm -rf apr rm -rf apr-util ln -s /home/tmp/httpd-2.2.4/srclib/apr apr ln -s /home/tmp/httpd-2.2.4/srclib/apr-util apr-util ./configure && make && make install安裝完成後,查看是否存在文件$APACHE_HOME/modules/mod_dav_svn.so(默認 /usr/local/apache2/modules/mod_dav_svn.so)。另外,如果該機器上以前是裝過舊版本的SVN,要把 "/usr/local/lib/libsvn*"文件都刪除。
<virtualhost *:80> DocumentRoot /home/svn/htdocs <directory> Options Includes AllowOverride All Order allow,deny Allow from all </directory> <location /> DAV svn SVNParentPath /home/svn/svnroot AuthzSVNAccessFile /home/svn/svnroot/conf/accessfile Require valid-user AuthType Basic AuthName "Subversion System" AuthUserFile /home/svn/svnroot/conf/passwdfile </location> ServerName svn.mydomain.net DirectoryIndex index.html </virtualhost> 創建文件/home/svn/svnroot/conf/accessfile: [groups] user = jarod anonymous = guest [/] * = r @user = rw @anonymous = r 再用htpasswd命令創建/home/svn/svnroot/conf/passwdfile文件: htpasswd -c /home/svn/svnroot/conf/passwdfile jarod # 這時會提示輸入密碼 最後把/home/svn目錄的擁有者設為啟動apache服務的用戶,apache-2.2默認會由daemon用戶啟動: chown daemon.daemon -R /home/svn chmod 777 /home/svn -R
大功告成,通過浏覽器或SVN客戶端測試http://svn.mydomain.net/repo1
原文地址