root  / my Debian tips&tricks  / Install Apache Subversion 

Official Debian logo

  1. Установим необходимые пакеты
    aptitude install subversion subversion-tools statsvn libapache2-mod-svn libapache2-svn
  2. Подготовим каталоги окружения
    mkdir /home/svn_repo_base
    chown admhome:admhome /home/svn_repo_base
    svnadmin create /home/svn_repo_base
  3. Создадим файл алиаса для SVN
    /etc/apache2/sites-available/subversion_domain.conf
    Содержимое файла
    # Main config file for apache subversion
    
    <Directory "/home/svn_repo_base/">
    	Order allow,deny
    	Allow from all
    	AllowOverride all
    
    	<Limit OPTIONS>
    		Order Deny,Allow
    		Allow from all
    	</Limit>
    
    	AuthType Basic
    	AuthName "Main SVN Repo"
    	AuthUserFile /etc/subversion/passwd
    	Require valid-user
    </Directory>
    
    <Location /svn>
    	DAV svn
    	SVNPath /home/svn_repo_base
    	# SVNParentPath /home
    	SVNReposName "Main SVN Repo"
    	SVNIndexXSLT "<...>/xslt/svnindex.xsl"
    	SVNListParentPath off
    	# SSLRequireSSL
    
    	AuthType Basic
    	AuthName "SVN Server"
    	AuthUserFile /etc/subversion/passwd
    	Require valid-user
    
    	# Authorization: Path-based access control; try anonymous access
    	#                first, but authenticate if necessary
    	# AuthzSVNAccessFile /etc/subversion/passwd
    	# Satisfy Any
    	# Require valid-user
    
    	<LimitExcept GET PUT PROPFIND OPTIONS REPORT>
    		AuthType Basic
    		AuthName "Main SVN Repo"
    		AuthUserFile /etc/subversion/passwd
    		Require valid-user
    	</LimitExcept>
    
    </Location>
  4. Включаем хост в Apache (и не забываем про reload)
    a2ensite
    /etc/init.d/apache2 reload
  5. Выполним необходимые команды со строны svn
    cd /etc/subversion/
    htpasswd -cB passwd admhome
    svnserve -d -r /home/svn_repo_base

Готово!

FB LJ