【发布时间】:2017-02-03 16:03:19
【问题描述】:
虽然看了很多帖子,还是没能解决这个问题。
我想使用 Git + Smart Http,在我的树莓派上使用远程存储库。
我在 Arch Linux 上运行。
首先,为了简单起见,让我们考虑一个 Http 配置(而不是 https)。
我的树莓派上正确安装了 Apache 和 Git,并且 Http 连接的端口是 8080。
在我的树莓派上:
1. 我在 /etc/httpd/conf/http.conf 中取消了关于 mod_cgi、mod_alias 和 mod_env 的行的注释
2. 我在 /etc/httpd/conf/http.conf 中添加了以下几行:
SetEnv GIT_PROJECT_ROOT /srv/git
SetEnv GIT_HTTP_EXPORT_ALL
ScriptAlias /git/ /usr/lib/git-core/git-http-backend/
<Directory "/usr/lib/git-core*">
Require all granted
</Directory>
-
我已经创建了目录 /srv/git
# mkdir -p /srv/git -
我已经创建并初始化了一个 git 存储库:
# mkdir -p /srv/git/test.git# git init --bare -
我已经更改了 repo 的所有者和组:
# chown -R http:http /srv/git/test.git
在我的客户端上:
-
我已经在文件夹中克隆了 repo
$ git clone @987654321@ -
我已经创建并添加了一个新文件并且我已经提交了
$ nano test.c$ git add test.c$ git commit -m 'first' -
我已经在我的 Rasperry Pi 上推送了新项目
$ git push origin master
但我有这个错误:
atal: unable to access 'address:8080/git/test.git/';: The requested URL returned error: 403
【问题讨论】:
-
什么版本的 Apache 和 Git 在你的服务器(树莓派)上运行
标签: linux git apache repository smart-http