どのように私は、セットアップApacheは、この特定のURLの設定とSVNを提供することができますか?

StackOverflow https://stackoverflow.com/questions/693098

  •  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ブロックは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>
// SVN:

あなたは、フォーム HTTPのURLをあなたのリポジトリにアクセスする必要があると思います。 domain.com/svn/project1/ のが、あなたはなどプロジェクト4を追加したい場合は、あなたがしなければならないすべてはの/ var / SVNの下に新しいリポジトリを追加している。

mod_rewriteののでしょうか?あなたは非SVNのもののためにフォルダを設定できます( http://example.com/info/する) 、その後、「/info/index.php」に「/」または「/index.php」の要求をリダイレクトするためのmod_rewriteを使用しています。それが動作しますか?

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top