Wie kann ich ein Setup Apache SVN mit dieser speziellen URL-Konfiguration zu dienen?
-
22-08-2019 - |
Frage
Ich habe einen VPS und ich versuche, mehr SVN-Projekte zu hosten. Ich würde die URL-Pfade mag so sein:
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
Doch mit dem folgenden Code, das erste, was (Welcome HTML-Seite) nicht zu sehen, da der Ort Block Vorrang vor dem DocumentRoot nimmt.
Zur Einstellung der Lage Block arbeitet auf <Location /repos>
, aber dann http://svn.domain.com/repos/project1
meine URLs werden, was Ich mag es nicht.
Irgendwelche Vorschläge?
<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>
Lösung
Sie können SVNPath Richtlinie, jedoch müssen Sie drei Standorten eingerichtet (jedes Projekt braucht seine eigene)
Andere Tipps
Sie können dieses Problem umgehen, ohne Ihre Apache-Konfiguration Sie fügen Sie ein neues Projekt jedes Mal zu ändern, indem eine Sub-Domain für Ihre SVN-Repositories hinzufügen. Sie würden mit etwas am Ende wie folgt:
<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>
Sie würden dann Ihre Repositories mit URLs der Form http: // svn. domain.com/svn/project1/ , aber wenn Sie hinzufügen möchten project4 usw. alles, was Sie tun müssen, ist das neue Repository unter / var / svn hinzuzufügen.
Was mod_rewrite ? Sie könnten einen Ordner für nicht-SVN Sachen einrichten ( http://example.com/info/ ) verwenden, dann mod_rewrite Anfragen zu umleiten für '/' oder '/index.php' to '/info/index.php'. Würde das funktionieren?