Git的,Debian的,Apache和智能HTTP [英] Git, Debian, Apache and Smart HTTP

查看:244
本文介绍了Git的,Debian的,Apache和智能HTTP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图建立的git我的Debian服务器上。不过,我要疯了这个聪明的HTTP的东西,因为我想用例如:It插件日食,它需要智能HTTP。基于这个原因,我无法对我的本地分支推到远程存储库我的服务器上。我已经安装了Apache和Git 1.7.2.3。我使用基本身份验证,并启用 mod_cgi一样 mod_env mod_alias中。对于混帐东西,我的Apache配置文件位于的/ etc / apache2的/网站的可用/混帐键,大约有如下内容:

I am trying to set up git on my Debian server. However, I'm going crazy about this Smart HTTP stuff, as I want to use the Egit plug-in for eclipse and it requires Smart HTTP. And for this reason I'm unable to push my local branch to the remote repository on my server. I have installed Apache and Git 1.7.2.3. I'm using Basic Authentication and have enabled mod_cgi, mod_env and mod_alias. My apache config file for the git stuff is located at /etc/apache2/sites-available/git and has about the following contents:

 <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>

该diretories如下:

The diretories are the following:


  • 的/ var /混帐:这是目录,我的所有存储库将

  • 的/ var /混帐/ allternative :这就是(裸)存储库撒谎说我正在试图建立目录

  • /var/git: This is the directory where all my repositories will be
  • /var/git/allternative: This is the directory where the (bare) repository lies that I'm currently trying to set up

我这样做,我这篇文章(和其他许多人说差不多)上读到的一切:的 http://progit.org/2010/03/04/smart-http.html

I did everything that I read on this article (and many others saying about the same): http://progit.org/2010/03/04/smart-http.html

我仍然可以从例如:It远程智能HTTP未启用的错误。我缺少什么?

I still get the error from Egit that remote Smart HTTP is not enabled. What am I missing?

在此先感谢,
安德烈亚斯

Thanks in advance, Andreas

推荐答案

回答我的问题:
我更换了的ScriptAlias​​ 指令与此:

Answering my own question: I replaced the ScriptAlias directive with this:

  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/ ,我不能完全确定这其中的两个问题解决了,但我假设它是 SETENV REMOTE_USER = $ REDIRECT_REMOTE_USER 指令。

Then it worked. I found those two settings on http://www.espace.com.eg/blog/2010/11/10/migrating-from-subversion-to-git/ and I'm not exactly sure which one of the two solved the problem, but I assume it was the SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER directive.

这篇关于Git的,Debian的,Apache和智能HTTP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆