![](/img/trans.png)
[英]git, apache, smart-http, ubuntu, convert from SSH access, does not ask for user, password
[英]convert git server from ssh to smart-http; ubuntu, apache; "Not a git repository " error
我正在尝试将 git 存储库从 ssh 访问权限转换为智能 http 访问权限。 我发现了各种古老的、相互矛盾的建议; 最近在这里。
我的客户.git/config
最初有以下 URL:
url = git@my-domain:/path-to-repos/my-project.git
我已将其更改为:
url = https://my-domain/my-project.git
当我发出命令时(适用于上面的 git@url):
git remote -v show origin
apache 服务器显示如下:
==> error.log <==
Not a git repository: '/path-to-repos/my-project.git'
==> access.log <==
a.b.c.d - - [12/Mar/2022:05:47:19 +0000] "GET /my-project.git/info/refs?service=
git-upload-pack HTTP/1.1" 404 4851 "-" "git/2.30.0"
回购设置drwxrwx--- git www-data
apache 启用了 mod cgi
、 alias
、 env
apache 站点配置文件具有:
SetEnv GIT_PROJECT_ROOT /path-to-repos
SetEnv GIT_HTTP_EXPORT_ALL
SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER
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"
Alias /git /path-to-repos
<Directory /usr/lib/git-core>
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
AllowOverride None
Require all granted
任何帮助将非常感激。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.