6

Httpd で SVN リポジトリをセットアップしています。現在、私のリポジトリは Httpd を介して利用できますが、誰でもチェックアウトしてコミットすることができます。Microsoft Active Directory 認証を使用してコミット アクションを制限したいと考えています。

私は私の中で以下を使用していますsubversion.conf

<Location /repos>
   DAV svn

   # Directory containing all repository for this path
   SVNParentPath /srv/svn/repositories

   # List repositories colleciton
   SVNListParentPath On

   # Enable WebDAV automatic versioning
   SVNAutoversioning On

   # Repository Display Name
   SVNReposName "RepositoryName"

   # Do basic password authentication in the clear
   AuthType Basic

   # The name of the protected area or "realm"
   AuthName "RepositoryName"

   # Make LDAP the authentication mechanism
   AuthBasicProvider ldap

   # Make LDAP authentication is final
   AuthzLDAPAuthoritative off

   # Active Directory requires an authenticating DN to access records
   #AuthLDAPBindDN "ou=people,o=example,dc=com"

   # The LDAP query URL
   AuthLDAPURL "ldap://example.com:389/DC=com,DC=example,ou=people?uid(objectClass=*)" NONE

   # Read access to everyone
   Satisfy Any

   # Require a valid user
   Require valid-user

   # Authorization file
   AuthzSVNAccessFile /subversion/apache2/auth/repos.acl

   # Limit write permission to list of valid users.
   #<LimitExcept GET PROPFIND OPTIONS REPORT>
      # Require SSL connection for password protection.
      # SSLRequireSSL

      #AuthType Basic
      #AuthName "Authorization Realm"
      #AuthUserFile /etc/httpd/conf/.htpasswd
      #Require valid-user
   #</LimitExcept>
</Location>

上記の構成では、毎回資格情報を要求します。また、提供された場合、リポジトリにはアクセスできません。正しい認証情報を入力すると、500 Internal Server Error が発生します。

ログファイルを確認しましたが、実際の原因を示すものはありませんでした。

4

5 に答える 5

6

<LimitExcept>パブリックの読み取り/チェックアウトを許可するには、ディレクティブの間のビットのコメントを外し、そのRequire valid-user上の別の行にコメントを付ける必要があります。

ディレクティブは、レポジトリのチェックアウト/読み取りに使用される、、またはリポジトリへのリクエストに<LimitExcept GET PROPFIND OPTIONS REPORT>は適用されない内部のすべてをサーバーに伝えます。言い換えると、このコードを Apache 構成に入れると、前述のメソッド以外には有効なユーザーのみが必要になります (たとえば、コミット要求が行われる場合は有効なユーザーが必要になります)。GETPROPFINDOPTIONSREPORTPUT

<LimitExcept GET PROPFIND OPTIONS REPORT>
    Require valid-user
</LimitExcept>

あなたの場合、おそらく次のようになるはずです(強制ログインの問題以外は正しいと仮定して、投稿された構成をわずかに変更しました(テストするLDAPサーバーがありません)。実際のサーバーに置き換えることに注意しexample.comてください。AuthLDAPURLホスト):

<Location /repos>
   DAV svn

   # Directory containing all repository for this path
   SVNParentPath /srv/svn/repositories

   # List repositories colleciton
   SVNListParentPath On

   # Enable WebDAV automatic versioning
   SVNAutoversioning On

   # Repository Display Name
   SVNReposName "RepositoryName"

   # Do basic password authentication in the clear
   AuthType Basic

   # The name of the protected area or "realm"
   AuthName "RepositoryName"

   # Make LDAP the authentication mechanism
   AuthBasicProvider ldap

   # Make LDAP authentication is final
   AuthzLDAPAuthoritative off

   # Active Directory requires an authenticating DN to access records
   #AuthLDAPBindDN "ou=people,o=example,dc=com"

   # The LDAP query URL
   AuthLDAPURL "ldap://example.com:389/DC=com,DC=example,ou=people?uid(objectClass=*)" NONE

   # Authorization file
   AuthzSVNAccessFile /subversion/apache2/auth/repos.acl

   # Limit write permission to list of valid users.
   <LimitExcept GET PROPFIND OPTIONS REPORT>
       SSLRequireSSL
       Require valid-user
   </LimitExcept>
</Location>

Require valid-userを の中に入れる限りLimitExcept、すべてが思いどおりに機能するはずです。残りの認証構成は、Locationディレクティブの間の任意の場所に配置できます。

于 2013-01-02T22:43:36.910 に答える
3

Ok。私は最初の部分を完了しました。

ここ6. Access control listsのセクションを参照して、ファイルに読み取り専用アクセスを追加しました。AuthzSVNAccessFile

# Authorization file
AuthzSVNAccessFile /srv/svn/repos.acl

/srv/svn/repos.aclファイルの内容

[/]
* = r

これで、すべてのリポジトリに匿名でアクセスできるようになります。これで、コミット部分が残っています。

コミットすると、次のメッセージが表示されます。

Commit failed (details follow):
Server sent unexpected return value (500 Internal Server Error) in response to 
MKACTIVITY request for '/repos/project1/!svn/act/783d45f7-ae05-134d-acb0-f36c007af59d'
于 2012-12-25T09:27:33.620 に答える
2

Visual SVN Serverを使用することをお勧めします。Active Directoryをサポートしています。Visual Svn Server は、apache および svn バイナリをインストールします。また、apache に必要な conf ファイルを作成します。

必要な機能をインストールして、作成された apache 構成ファイルを調べます。また、Windowsボックスで実行できる場合は、Apacheサーバーを維持する代わりに、それを使用/購入することをお勧めします.

于 2012-12-28T11:50:27.773 に答える
2

いくつかのメモ:

  1. SVNAutoversioningSubversionの場所で使用されているのを見たことがありません
  2. Apacheエラーログを読むと、トラブルの場合に「500エラー」よりも詳細な情報を得ることができます
  3. ここで、SO で、Apache プロセスの所有者に関連する、CentOS での Subversion のトラブルに関するいくつかのトピックを読みました (httpd の一部のプロセスには、別のプロセスとは異なる所有者がいます: nobody および httpd): で確認してくださいps -au | grep
  4. 通常、不十分な権限に関連するコミットの問題: Apache プロセスには、リポジトリ内のすべてのファイルに対する書き込み権限が必要です
  5. 最後になりましたが、重要なことですが、pp. 3-4 よりも優先度が高くなります -AuthzSVNAccessFile少なくとも 1 つのパスに少なくとも 1 つのユーザー|グループを使用する場合、... = rwコミットするには書き込み権限が必要です。repos.acl ファイルに AD から継承されたユーザー名を書き込む方法がわからない
于 2012-12-28T12:45:08.537 に答える