3

Debianサーバーでgitをセットアップしようとしています。ただし、EclipseにEgitプラグインを使用したいので、このSmart HTTPに夢中になり、SmartHTTPが必要になります。このため、ローカルブランチをサーバー上のリモートリポジトリにプッシュできません。ApacheとGit1.7.2.3をインストールしました。基本認証を使用していて、、、を有効mod_cgimod_envmod_aliasました。gitのもののapache設定ファイルはにあり/etc/apache2/sites-available/git、次の内容が含まれています。

 <VirtualHost *:80>
         Servername git.mydomain.com
         DocumentRoot /var/git
         SetEnv GIT_PROJECT_ROOT /var/git/
         SetEnv GIT_HTTP_EXPORT_ALL
         ScriptAlias /git/ /usr/lib/git-core/git-http-backend/
         <Directory "/var/git">
            DAV On
            Options +Indexes +FollowSymLinks
            Deny from all
            AuthType Basic
            AuthName "git repository"
            AuthUserFile /var/git/.htpasswd
            AuthGroupFile /var/git/.htgroup
         </Directory>
         <Directory /var/git/allternative>
                 Allow from all
                 Order allow,deny
                 Require group allternative
         </Directory>
         <Directory "/usr/lib/git-core/git-receive-pack">
                 Allow from all
                 Order allow,deny
                 Require group allternative
         </Directory>
 </VirtualHost>

ディレクトリは次のとおりです。

  • /var/git:これは私のすべてのリポジトリが置かれるディレクトリです
  • /var/git/allternative:これは、私が現在設定しようとしている(ベア)リポジトリが存在するディレクトリです。

私はこの記事で読んだすべてのことをしました(そして他の多くの人が同じことについて言っています):http://progit.org/2010/03/04/smart-http.html

Egitから、リモートSmartHTTPが有効になっていないというエラーが引き続き表示されます。私は何が欠けていますか?

よろしくお願いします、アンドレアス

4

2 に答える 2

4

私自身の質問に答える:私はScriptAliasディレクティブをこれに置き換えました:

  ScriptAliasMatch \
    "(?x)^/(.*/(HEAD | \
      info/refs | \
        objects/(info/[^/]+ | \
          [0-9a-f]{2}/[0-9a-f]{38} | \
            pack/pack-[0-9a-f]{40}\.(pack|idx)) | \
              git-(upload|receive)-pack))$" \
               "/usr/lib/git-core/git-http-backend/$1"

また、次のディレクティブを追加しました。

SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER

それからそれは働いた。http://www.espace.com.eg/blog/2010/11/10/migrating-from-subversion-to-git/でこれらの2つの設定を見つけましたが、2つのうちどちらが解決したか正確にはわかりません。問題がありますが、それはSetEnv REMOTE_USER=$REDIRECT_REMOTE_USERディレクティブだったと思います。

于 2011-11-10T15:54:15.277 に答える
3

ServerAdmin     admin@server.ru
ServerName      git.server.ru
ServerAlias     git
UseCanonicalName Off

# path to repo
DocumentRoot    /srv/git
DavLockDB "/var/lock/davlock"

SetEnv GIT_PROJECT_ROOT /srv/git
SetEnv GIT_HTTP_EXPORT_ALL
#in Progit http://progit.org/2010/03/04/smart-http.html next line is omitted and
#we get an error. So next line is a mandatory requirement.
SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER

#Don't uncomment line below. It's a second error.
#ScriptAlias / /usr/lib/git-core/git-http-backend/

#but this works

 ScriptAliasMatch \
    "(?x)^/(.*/(HEAD | \
           info/refs | \
           objects/(info/[^/]+ | \
                 [0-9a-f]{2}/[0-9a-f]{38} | \
                    pack/pack-[0-9a-f]{40}\.(pack|idx)) | \
                    git-(upload|receive)-pack))$" \
                    "/usr/lib/git-core/git-http-backend/$1"

 #making accessible scripts
  <Directory /usr/lib/git-core/>
      Options +ExecCGI
  Order Allow,Deny      
  Allow from all
  </Directory>

 #opening access to our git repos
 <Directory /srv/git>
Dav on
Order Allow,Deny        
Allow from all
Options +Indexes                       
</Directory>

#need only for auth.
<LocationMatch "^.*/git-receive-pack$">
    AuthType Basic
    AuthName "Git Access"
    AuthUserFile /srv/git/passwd.git
    Require valid-user
</LocationMatch>

LogLevel warn
ErrorLog /var/log/httpd/git-error.log        
CustomLog /var/log/httpd/git-access.log combined

于 2012-04-07T07:02:32.780 に答える