{"id":4202,"date":"2014-10-24T18:03:56","date_gmt":"2014-10-24T10:03:56","guid":{"rendered":"https:\/\/www.hmouse.tk\/?p=4202"},"modified":"2014-10-27T14:39:56","modified_gmt":"2014-10-27T06:39:56","slug":"git-apache-%e9%85%8d%e7%bd%ae","status":"publish","type":"post","link":"https:\/\/www.hmouse.cn\/?p=4202","title":{"rendered":"git-apache \u5b89\u88c5\u4e0e\u914d\u7f6e"},"content":{"rendered":"<p>\u5b89\u88c5\uff1ayum -y install mod_ssl&nbsp; httpd mod_dav mod_dav_fs<\/p>\n<p>git \uff1a <\/p>\n<p>yum -y install gettext-devel expat-devel curl-devel zlib-devel openssl-devel gcc perl-devel<\/p>\n<p>cd \/usr\/local\/src<br \/>wget <a href=\"https:\/\/www.kernel.org\/pub\/software\/scm\/git\/git-1.8.2.3.tar.gz\">https:\/\/www.kernel.org\/pub\/software\/scm\/git\/git-1.8.2.3.tar.gz<\/a><br \/>tar xzvf git-1.8.2.3.tar.gz<br \/>cd git-1.8.2.3<br \/>make prefix=\/usr\/local all<br \/>make prefix=\/usr\/local install<\/p>\n<p>\u914d\u7f6e<\/p>\n<p>[root@localhost git]# cat \/etc\/httpd\/conf.d\/git.conf <br \/>SetEnv GIT_PROJECT_ROOT \/var\/www\/html\/git<br \/>SetEnv GIT_HTTP_EXPORT_ALL<br \/>ScriptAlias \/git \/usr\/local\/libexec\/git-core\/git-http-backend<br \/>&lt;LocationMatch &#8220;^\/git\/test.git\/.*$&#8221;&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dav On<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Options +Indexes +FollowSymLinks <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AuthType Basic<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AuthName &#8220;Git Access&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AuthType Basic<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AuthName &#8220;Please login&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AuthBasicProvider ldap<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AuthLDAPURL &#8220;ldap:\/\/192.168.7.1:389\/ou=system-admin,ou=login,dc=test,dc=com&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AuthLDAPBindDN &#8220;cn=admin,dc=test,dc=com&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AuthLDAPBindPassword &#8220;test&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Require valid-user<br \/>&lt;\/LocationMatch&gt;<\/p>\n<p>\u9047\u5230\u7684\u95ee\u9898\uff1a<\/p>\n<p>\u9047\u5230\u4e00\u4e2a\u5947\u602a\u7684\u95ee\u9898\uff0c\u642d\u5efa\u597dgit\u4e4b\u540e\uff0c\u5f88\u5947\u602a\u7684\u95ee\u9898\u3002linux\u4e0b\u63d0\u4ea4\u65e0\u95ee\u9898\uff0c\u4f46\u662fwindows \u63d0\u4ea4\u7684\u65f6\u5019\u4e00\u76f4\u62a5<\/p>\n<p>git.exe push &#8211;progress&nbsp; &#8220;origin&#8221; master:master<\/p>\n<p>git: &#8216;http-push&#8217; is not a git command. See &#8216;git &#8211;help&#8217;.<br \/>fatal: git-http-push failed<\/p>\n<p><a href=\"https:\/\/www.hmouse.cn\/wp-content\/uploads\/2014\/10\/image2.png\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/www.hmouse.cn\/wp-content\/uploads\/2014\/10\/image_thumb2.png\" width=\"244\" height=\"165\"><\/a><\/p>\n<p>\u540e\u6765\u4ece\u4e00\u7bc7\u6587\u7ae0\u53d1\u73b0\uff1a<\/p>\n<p>\u65b0\u589e\u4e00config\u6863\uff0c\u5e76\u7f16\u8f91\u5b83\/etc\/httpd\/conf.d\/git.conf \uff0c\u8ba9Apache\u77e5\u9053GIT\u7684Repository ROOT\u5728\u54ea\uff1f \u54ea\u4e2aURI\u4f1a\u8981\u8c03\u7528git-http-backend\uff1f<\/p>\n<p>\u914d\u7f6e\u6dfb\u52a0<\/p>\n<p>SetEnv GIT_PROJECT_ROOT \/opt\/git<br \/>SetEnv GIT_HTTP_EXPORT_ALL<br \/>ScriptAlias \/git\/ \/usr\/lib\/git-core\/git-http-backend\/<\/p>\n<p>\u63d0\u4ea4\u7684\u65f6\u5019\u5c31\u6ca1\u6709\u95ee\u9898\u4e86\u3002<\/p>\n<p>\u800c\u4e14 \u5982\u679c\u6ca1\u6709\u914d\u7f6e\u4ee5\u4e0a\u5185\u5bb9\u3002\u9700\u8981\u6267\u884cgit update-server-info&nbsp; \u5426\u5219\uff0cclone\u4f1a\u62a5\u9519\uff0c<\/p>\n<p>[Fri Oct 24 17:59:05 2014] [error] [client 192.168.0.151] File does not exist: <font color=\"#ff0000\">\/var\/www\/html\/git\/test.git\/info\/refs<\/font><\/p>\n<p><font color=\"#000000\">\u4f46\u662f\u5982\u679c\u914d\u7f6e\u4ee5\u4e0a\u5185\u5bb9\u7684\u8bdd\uff0c\u5219\u65e0\u9700\u914d\u7f6e\u4e5f\u80fdclone\u3002<\/font><\/p>\n<p>\u53c2\u8003\uff1a<\/p>\n<p><a title=\"http:\/\/translate.google.com.hk\/translate?hl=zh-CN&amp;sl=zh-TW&amp;u=http:\/\/blog.xuite.net\/zack_pan\/blog\/65273998-GIT%2Bover%2BHTTP%2B%28GIT%2BHTTP%2BTransparent%29&amp;prev=\/search%3Fq%3Dfatal:%2Bgit-http-push%2Bfailed%26newwindow%3D1%26safe%3Dstrict%26sa%3DN%26biw%3D1319%26bih%3D749\" href=\"http:\/\/translate.google.com.hk\/translate?hl=zh-CN&amp;sl=zh-TW&amp;u=http:\/\/blog.xuite.net\/zack_pan\/blog\/65273998-GIT%2Bover%2BHTTP%2B%28GIT%2BHTTP%2BTransparent%29&amp;prev=\/search%3Fq%3Dfatal:%2Bgit-http-push%2Bfailed%26newwindow%3D1%26safe%3Dstrict%26sa%3DN%26biw%3D1319%26bih%3D749\">http:\/\/translate.google.com.hk\/translate?hl=zh-CN&amp;sl=zh-TW&amp;u=http:\/\/blog.xuite.net\/zack_pan\/blog\/65273998-GIT%2Bover%2BHTTP%2B%28GIT%2BHTTP%2BTransparent%29&amp;prev=\/search%3Fq%3Dfatal:%2Bgit-http-push%2Bfailed%26newwindow%3D1%26safe%3Dstrict%26sa%3DN%26biw%3D1319%26bih%3D749<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b89\u88c5\uff1ayum -y install mod_ssl&nbsp; httpd mod_dav mod_dav_fs<\/p>\n<p>git \uff1a <\/p>\n<p>yum -y install gettext-devel expat-devel curl-devel zlib-devel openssl-devel gcc perl-devel<\/p>\n<p>cd \/usr\/local\/src<br \/>wget <a href=\"https:\/\/www.kernel.org\/pub\/software\/scm\/git\/git-1.8.2.3.tar.gz\">https:\/\/www.kernel.org\/pub\/software\/scm\/git\/git-1.8.2.3.tar.gz<\/a><br \/>tar xzvf git-1.8.2.3.tar.gz<br \/>cd git-1.8.2.3<br \/>make prefix=\/usr\/local all<br \/>make prefix=\/usr\/local install<\/p>\n<p>\u914d\u7f6e<\/p>\n<p>[root@localhost git]# cat \/etc\/httpd\/conf.d\/git.conf <br \/>SetEnv GIT_PROJECT_ROOT \/var\/www\/html\/git<br \/>SetEnv GIT_HTTP_EXPORT_ALL<br \/>ScriptAlias \/git \/usr\/local\/libexec\/git-core\/git-http-backend<br \/>&lt;LocationMatch &#8220;^\/git\/test.git\/.*$&#8221;&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dav On<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Options +Indexes +FollowSymLinks <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AuthType Basic<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AuthName &#8220;Git Access&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AuthType Basic<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AuthName &#8220;Please login&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AuthBasicProvider ldap<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AuthLDAPURL &#8220;ldap:\/\/192.168.7.1:389\/ou=system-admin,ou=login,dc=test,dc=com&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AuthLDAPBindDN &#8220;cn=admin,dc=test,dc=com&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AuthLDAPBindPassword &#8220;test&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Require valid-user<br \/>&lt;\/LocationMatch&gt;<\/p>\n<p>\u9047\u5230\u7684\u95ee\u9898\uff1a<\/p>\n<p>\u9047\u5230\u4e00\u4e2a\u5947\u602a\u7684\u95ee\u9898\uff0c\u642d\u5efa\u597dgit\u4e4b\u540e\uff0c\u5f88\u5947\u602a\u7684\u95ee\u9898\u3002linux\u4e0b\u63d0\u4ea4\u65e0\u95ee\u9898\uff0c\u4f46\u662fwindows \u63d0\u4ea4\u7684\u65f6\u5019\u4e00\u76f4\u62a5<\/p>\n<p>git.exe push &#8211;progress&nbsp; &#8220;origin&#8221; master:master<\/p>\n<p>git: &#8216;http-push&#8217; is not a git command. See &#8216;git &#8211;help&#8217;.<br \/>fatal: git-http-push failed<\/p>\n<p><a href=\"https:\/\/www.hmouse.cn\/wp-content\/uploads\/2014\/10\/image2.png\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/www.hmouse.cn\/wp-content\/uploads\/2014\/10\/image_thumb2.png\" width=\"244\" height=\"165\"><\/a><\/p>\n<p>\u540e\u6765\u4ece\u4e00\u7bc7\u6587\u7ae0\u53d1\u73b0\uff1a<\/p>\n<p>\u65b0\u589e\u4e00config\u6863\uff0c\u5e76\u7f16\u8f91\u5b83\/etc\/httpd\/conf.d\/git.conf \uff0c\u8ba9Apache\u77e5\u9053GIT\u7684Repository ROOT\u5728\u54ea\uff1f \u54ea\u4e2aURI\u4f1a\u8981\u8c03\u7528git-http-backend\uff1f<\/p>\n<p>\u914d\u7f6e\u6dfb\u52a0<\/p>\n<p>SetEnv GIT_PROJECT_ROOT \/opt\/git<br \/>SetEnv GIT_HTTP_EXPORT_ALL<br \/>ScriptAlias \/git\/ \/usr\/lib\/git-core\/git-http-backend\/<\/p>\n<p>\u63d0\u4ea4\u7684\u65f6\u5019\u5c31\u6ca1\u6709\u95ee\u9898\u4e86\u3002<\/p>\n<p>\u800c\u4e14 \u5982\u679c\u6ca1\u6709\u914d\u7f6e\u4ee5\u4e0a\u5185\u5bb9\u3002\u9700\u8981\u6267\u884cgit update-server-info&nbsp; \u5426\u5219\uff0cclone\u4f1a\u62a5\u9519\uff0c<\/p>\n<p>[Fri Oct 24 17:59:05 2014] [error] [client 192.168.0.151] File does not exist: <font color=\"#ff0000\">\/var\/www\/html\/git\/test.git\/info\/refs<\/font><\/p>\n<p><font color=\"#000000\">\u4f46\u662f\u5982\u679c\u914d\u7f6e\u4ee5\u4e0a\u5185\u5bb9\u7684\u8bdd\uff0c\u5219\u65e0\u9700\u914d\u7f6e\u4e5f\u80fdclone\u3002<\/font><\/p>\n<p>\u53c2\u8003\uff1a<\/p>\n<p><a title=\"http:\/\/translate.google.com.hk\/translate?hl=zh-CN&amp;sl=zh-TW&amp;u=http:\/\/blog.xuite.net\/zack_pan\/blog\/65273998-GIT%2Bover%2BHTTP%2B%28GIT%2BHTTP%2BTransparent%29&amp;prev=\/search%3Fq%3Dfatal:%2Bgit-http-push%2Bfailed%26newwindow%3D1%26safe%3Dstrict%26sa%3DN%26biw%3D1319%26bih%3D749\" href=\"http:\/\/translate.google.com.hk\/translate?hl=zh-CN&amp;sl=zh-TW&amp;u=http:\/\/blog.xuite.net\/zack_pan\/blog\/65273998-GIT%2Bover%2BHTTP%2B%28GIT%2BHTTP%2BTransparent%29&amp;prev=\/search%3Fq%3Dfatal:%2Bgit-http-push%2Bfailed%26newwindow%3D1%26safe%3Dstrict%26sa%3DN%26biw%3D1319%26bih%3D749\">http:\/\/translate.google.com.hk\/translate?hl=zh-CN&amp;sl=zh-TW&amp;u=http:\/\/blog.xuite.net\/zack_pan\/blog\/65273998-GIT%2Bover%2BHTTP%2B%28GIT%2BHTTP%2BTransparent%29&amp;prev=\/search%3Fq%3Dfatal:%2Bgit-http-push%2Bfailed%26newwindow%3D1%26safe%3Dstrict%26sa%3DN%26biw%3D1319%26bih%3D749<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[60,58],"class_list":["post-4202","post","type-post","status-publish","format-standard","hentry","category-5","tag-fatal-git-http-push-failed","tag-git","category-5-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=\/wp\/v2\/posts\/4202","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4202"}],"version-history":[{"count":3,"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=\/wp\/v2\/posts\/4202\/revisions"}],"predecessor-version":[{"id":4207,"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=\/wp\/v2\/posts\/4202\/revisions\/4207"}],"wp:attachment":[{"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4202"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4202"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4202"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}