이 특정 URL 구성으로 SVN에 서비스를 제공하도록 Apache를 설정하려면 어떻게해야합니까?
-
22-08-2019 - |
문제
VPS가 있고 여러 SVN 프로젝트를 주최하려고합니다. URL 경로가 다음과 같이되기를 바랍니다.
http://svn.domain.com -> Welcome HTML page (at /var/www/svn.domain.com/httpdocs/index.php)
http://svn.domain.com/project1 -> Project 1 SVN Root
http://svn.domain.com/project2 -> Project 2 SVN Root
http://svn.domain.com/project3 -> Project 3 SVN Root
그러나 아래 코드를 사용하면 Location Block이 DocumentRoot보다 우선하기 때문에 첫 번째 코드 (환영 HTML 페이지)가 표시되지 않습니다.
위치 블록을 설정합니다 <Location /repos>
작동하지만 내 URL이됩니다 http://svn.domain.com/repos/project1
, 내가 싫어하는 것.
제안이 있습니까?
<VirtualHost *>
ServerName svn.domain.com
DocumentRoot /var/www/svn.domain.com/httpdocs
<Location />
DAV svn
SVNParentPath /var/svn
SVNIndexXSLT "/svnindex.xsl"
AuthzSVNAccessFile /var/svn/access
SVNListParentPath On
# try anonymous access first, resort to real
# authentication if necessary.
Satisfy Any
Require valid-user
# how to authenticate a user
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /var/svn/passwd
</Location>
</VirtualHost>
<Directory /var/svn>
Allow from all
</Directory>
해결책
당신이 사용할 수있는 svnpath 지침이지만 세 곳을 설정해야합니다 (각 프로젝트는 자체가 필요합니다)
다른 팁
SVN 리포지토리의 하위 도메인을 추가하여 새 프로젝트를 추가 할 때마다 Apache 구성을 변경하지 않고도이 문제를 해결할 수 있습니다. 당신은 다음과 같은 것으로 끝납니다.
<VirtualHost *>
ServerName svn.domain.com
DocumentRoot /var/www/svn.domain.com/httpdocs
<Location /svn>
DAV svn
SVNParentPath /var/svn
SVNIndexXSLT "/svnindex.xsl"
AuthzSVNAccessFile /var/svn/access
SVNListParentPath On
# try anonymous access first, resort to real
# authentication if necessary.
Satisfy Any
Require valid-user
# how to authenticate a user
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /var/svn/passwd
</Location>
<Directory /var/svn>
Allow from all </Directory>
<Directory /var/www/svn.domain.com/httpdocs>
# Doc. root directives here</Directory>
그런 다음 양식의 URL로 리포지토리에 액세스해야합니다. http://svn.domain.com/svn/project1/, 그러나 프로젝트 4 등을 추가하려면 /var /svn에서 새 저장소를 추가하기 만하면됩니다.
는 어때 mod_rewrite? 비 SVN 물건에 대한 폴더를 설정할 수 있습니다 (http://example.com/info/), 그런 다음 mod_rewrite를 사용하여 '/'또는 '/index.php'에 대한 요청을 '/info/index.php'로 리디렉션하십시오. 그게 작동할까요?
제휴하지 않습니다 StackOverflow