我正在通过 OpenSUSE(非虚拟主机)中的 Apache 在我的系统中配置 gitweb。但是,我收到以下错误:404 - No projects found
.
/etc/gitweb.conf
# path to git projects (<project>.git)
$projectroot = "/home/zhijian/gitweb";
# directory to use for temp files
$git_temp = "/tmp";
# target of the home link on top of all pages
#$home_link = $my_uri || "/";
# html text to include at home page
$home_text = "/gitweb/static/indextext.html";
# file with project list; by default, simply scan the projectroot dir.
$projects_list = $projectroot;
# stylesheet to use
$stylesheet = "/gitweb/static/gitweb.css";
# logo to use
$logo = "/gitweb/static/git-logo.png";
# the 'favicon'
$favicon = "/gitweb/static/git-favicon.png";
/etc/apache2/conf.d/gitweb.conf
Alias /gitweb "/home/zhijian/gitweb"
<Directory "/home/zhijian/gitweb">
Options +Indexes +ExecCGI +FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
AddHandler cgi-script .cgi
DirectoryIndex gitweb.cgi
</Directory>
我在 gitweb 文件夹中添加了一个软链接(soft link)来链接 gitweb.cgi 和静态文件夹。 Apache 错误日志显示
gitweb.cgi: Can't opendir(/home/zhijian/gitweb): Permission denied
,但 gitweb 文件夹的权限已设置为 755。有人知道可能导致此问题的原因吗?
最佳答案
我在 OpenSuse 11.4 中也遇到了同样的问题。在我的情况下(我怀疑最初的发帖人就是这种情况,他也是一名 opensuse 用户),问题出在 AppArmor 上,我对此知之甚少。
以下是我注意到导致最终解决方案的一些要点:
...
/srv/git/ r,
/srv/git/** r,
...
...
/home/myname/srv r,
/home/myname/srv/** r,
...
现在一切都应该好了:)
关于gitweb - 配置 GitWeb - 404 - 未找到项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10275536/