Re: [git-users] httpd backend - repo not found.
On Tue, Aug 14, 2018 at 02:24:30AM -0700, christian.tre...@itsv.at wrote: > i am trying to set up gitweb and the http backend. gitweb works so far, but > the http backend is giving me headaches. i always get "fatal: repository > not found errors, which is quite frustrating as gitweb works perfectly > well with the same url. i wasted hours on this, so any help would be really > nice! Setting this stuff right might indeed be tricky. I would highly recommend you to first disable mod_rewrite altogether and try to get it working without it. The reason is that in my personal experience (with web developers) using mod_rewrite is their first and often the sole tactic in trying to solve any issue of mapping URLs to the filesystem, and unfortunately, mod_rewrite is another moving part in the already complicated gizmo, and the way it moves is not obvious. Okay, the way Git works via HTTP is actually documented in [1], and trust me, you're supposed to read it several times to understand completely. One of the major takeaways from it is that base part of your "Git" URL must be mapped to the filesystem pathname of the `git-http-backend` binary installed in your system. IOW, if you cant, say, your repos to be located via, say, "http://test.sozvers.at/git/..."; URLs, the base path "/git/" (notice the trailing slash!) on the vhost serving "test.sozvers.at" must map exactly to something like "/usr/lib/git-core/git-http-backend/" (notice the trailing slash, again!). The pathname shown is okay for Git packaged for Debian (and its derivatives; check the package provided by your OS) to find out where the git-http-backend binary is located on your system. A typical way to map base pathnames from URLs to the git-http-backend binary is through the ScriptAlias directive, like in Here is a skeleton example of a vhost serving both Git and Gitweb: ServerName git.domain.local ServerAlias git ServerAdmin webmaster@domain.local DocumentRoot /var/www/git Require all denied AllowOverride none Options none Options +FollowSymLinks +ExecCGI AddHandler cgi-script .cgi ScriptAlias /git/ /usr/lib/git-core/git-http-backend/ To make it fully working, you'd have to set up the GIT_PROJECT_ROOT environment variable in your vhost config for Git to be able to find the repositories. See [1] for more info. After having the basic stipped down setup working, you may add proper directives to tighten access controls, if needed. One another possible caveat is that if you're using mod_suexec to make Git repos be served using the credentials of a dedicated user - different from that of the web server process is using - stuff gets more complicated as mod_suexec strips all the environment variables set in the vhost config. If you have this situation, ask away as I have a workaround. 1. https://mirrors.edge.kernel.org/pub/software/scm/git/docs/git-http-backend.html -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[git-users] httpd backend - repo not found.
i am trying to set up gitweb and the http backend. gitweb works so far, but the http backend is giving me headaches. i always get "fatal: repository not found errors, which is quite frustrating as gitweb works perfectly well with the same url. i wasted hours on this, so any help would be really nice! root@lpgaixmgmtlx01:/etc/ansible/aix>git remote -v origin http://lpgaixmgmtlx01.test.sozvers.at/git/ansible.git (fetch) origin http://lpgaixmgmtlx01.test.sozvers.at/git/ansible.git (push) root@lpgaixmgmtlx01:/etc/ansible/aix>git remote show origin Username for 'http://lpgaixmgmtlx01.test.sozvers.at': tremch Password for 'http://tre...@lpgaixmgmtlx01.test.sozvers.at': fatal: repository 'http://lpgaixmgmtlx01.test.sozvers.at/git/ansible.git/' not found apache error log [Tue Aug 14 11:22:04.701868 2018] [rewrite:trace3] [pid 18507] mod_rewrite.c (470): [client 172.16.172.154:33378] 172.16.172.154 - tremch [lpgaixmgmtlx01 .test.sozvers.at/sid#1000b91f350][rid#1000bbc6280/initial] [perdir /var/www/git/] add path info postfix: /var/www/git/ansible.git -> /var/www/git/ansible.git/info/refs [Tue Aug 14 11:22:04.701899 2018] [rewrite:trace3] [pid 18507] mod_rewrite.c (470): [client 172.16.172.154:33378] 172.16.172.154 - tremch [lpgaixmgmtlx01 .test.sozvers.at/sid#1000b91f350][rid#1000bbc6280/initial] [perdir /var/www/git/] strip per-dir prefix: /var/www/git/ansible.git/info/refs -> ansible.git/info/refs [Tue Aug 14 11:22:04.701911 2018] [rewrite:trace3] [pid 18507] mod_rewrite.c (470): [client 172.16.172.154:33378] 172.16.172.154 - tremch [lpgaixmgmtlx01 .test.sozvers.at/sid#1000b91f350][rid#1000bbc6280/initial] [perdir /var/www/git/] applying pattern '^.*' to uri 'ansible.git/info/refs' [Tue Aug 14 11:22:04.701957 2018] [rewrite:trace2] [pid 18507] mod_rewrite.c (470): [client 172.16.172.154:33378] 172.16.172.154 - tremch [lpgaixmgmtlx01 .test.sozvers.at/sid#1000b91f350][rid#1000bbc6280/initial] [perdir /var/www/git/] rewrite 'ansible.git/info/refs' -> '/git/gitweb.cgi/ansible.git/info/refs' [Tue Aug 14 11:22:04.701968 2018] [rewrite:trace2] [pid 18507] mod_rewrite.c (470): [client 172.16.172.154:33378] 172.16.172.154 - tremch [lpgaixmgmtlx01 .test.sozvers.at/sid#1000b91f350][rid#1000bbc6280/initial] [perdir /var/www/git/] forcing '/git/gitweb.cgi/ansible.git/info/refs' to get passed through to next API URI-to-filename handler [Tue Aug 14 11:22:04.701977 2018] [rewrite:trace1] [pid 18507] mod_rewrite.c (470): [client 172.16.172.154:33378] 172.16.172.154 - tremch [lpgaixmgmtlx01 .test.sozvers.at/sid#1000b91f350][rid#1000bbc6280/initial] [perdir /var/www/git/] internal redirect with /git/gitweb.cgi/ansible.git/info/refs [INTERNAL REDIRECT] [Tue Aug 14 11:22:04.702126 2018] [rewrite:trace3] [pid 18507] mod_rewrite.c (470): [client 172.16.172.154:33378] 172.16.172.154 - tremch [lpgaixmgmtlx01 .test.sozvers.at/sid#1000b91f350][rid#1000bbca848/initial/redir#1] [perdir /var/www/git/] add path info postfix: /var/www/git/gitweb.cgi -> /var/www/git/gitweb.cgi/ansible.git/info/refs [Tue Aug 14 11:22:04.702135 2018] [rewrite:trace3] [pid 18507] mod_rewrite.c (470): [client 172.16.172.154:33378] 172.16.172.154 - tremch [lpgaixmgmtlx01 .test.sozvers.at/sid#1000b91f350][rid#1000bbca848/initial/redir#1] [perdir /var/www/git/] strip per-dir prefix: /var/www/git/gitweb.cgi/ansible.git/info/refs -> gitweb.cgi/ansible.git/info/refs [Tue Aug 14 11:22:04.702143 2018] [rewrite:trace3] [pid 18507] mod_rewrite.c (470): [client 172.16.172.154:33378] 172.16.172.154 - tremch [lpgaixmgmtlx01 .test.sozvers.at/sid#1000b91f350][rid#1000bbca848/initial/redir#1] [perdir /var/www/git/] applying pattern '^.*' to uri 'gitweb.cgi/ansible.git/info/refs' [Tue Aug 14 11:22:04.702154 2018] [rewrite:trace1] [pid 18507] mod_rewrite.c (470): [client 172.16.172.154:33378] 172.16.172.154 - tremch [lpgaixmgmtlx01 .test.sozvers.at/sid#1000b91f350][rid#1000bbca848/initial/redir#1] [perdir /var/www/git/] pass through /var/www/git/gitweb.cgi [Tue Aug 14 11:22:04.789914 2018] [cgi:error] [pid 18507] [client 172.16. 172.154:33378] AH01215: warning: ignoring broken ref info/refs. [Tue Aug 14 11:22:04.790045 2018] [cgi:error] [pid 18507] [client 172.16. 172.154:33378] AH01215: fatal: Not a valid object name info/refs my configs: apache config: LogLevel rewrite:trace3 Alias /git /var/www/git Options +ExecCGI +FollowSymLinks +SymLinksIfOwnerMatch AddHandler cgi-script cgi DirectoryIndex gitweb.cgi Require all granted RewriteEngine on # PATH_INFO usage for pretty URLs # make sure to enable it in gitweb.conf # # $feature{'pathinfo'}{'default'} = [1]; # RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^.* /git/gitweb.cgi/$0 [L,PT] ScriptAliasMatch \ "(?x)^/git/ (.*/(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/libexec/git-core/git-http-backend/$1 Options