我正在尝试在安装了 git/gitweb 1.7.1 和 httpd 2.2.15 的 CentOS 6.2 服务器上安装 gitweb。
gitweb 的默认项目根目录(在 CGI 脚本中验证)是 /var/lib/git,所以我在其中创建了它和一个裸 git 存储库:
$ ls -laF /var/lib/git
total 12
drwxrwxr-x. 3 git git 4096 Feb 8 16:37 ./
drwxr-xr-x. 15 root root 4096 Feb 8 14:20 ../
drwxrwxr-x. 7 git git 4096 Feb 8 15:37 foo/
$ git init --bare --shared foo
Initialized empty shared Git repository in /var/lib/git/foo/
$ ls -lF foo
total 32
drwxrwsr-x. 2 git git 4096 Feb 8 17:16 branches/
-rw-rw-r--. 1 git git 126 Feb 8 17:16 config
-rw-rw-r--. 1 git git 73 Feb 8 17:16 description
-rw-rw-r--. 1 git git 23 Feb 8 17:16 HEAD
drwxrwsr-x. 2 git git 4096 Feb 8 17:16 hooks/
drwxrwsr-x. 2 git git 4096 Feb 8 17:16 info/
drwxrwsr-x. 4 git git 4096 Feb 8 17:16 objects/
drwxrwsr-x. 4 git git 4096 Feb 8 17:16 refs/
$ cat foo/HEAD
ref: refs/heads/master
但是在查看http://localhost/git/
时,我看到“404 No projects found”。
我已经通过脚本进行了调试,可以看到它正在查找/var/lib/git/foo
,但是 Perl 的-e
操作符在/var/lib/git/foo/HEAD
. 在文件的同一位置,反引号调用ls
显示该文件在那里可见,但我无法让 Perl-e
看到该文件。
知道什么可能导致此失败吗?这对我来说毫无意义。
编辑:注意这个 CentOS 机器上的 SELinux 扩展似乎被禁用:
$ sudo sestatus
SELinux status: disabled
编辑:将所有内容从 移动/var/lib/git
到/git
没有帮助。我已将apache
用户更改为拥有真正的 shell,以该用户身份登录,并验证它可以访问所有有问题的目录和文件。