我在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文件夹中添加了一个软链接来链接gitweb.cgi和静态文件夹。Apache错误日志显示gitweb.cgi: Can't opendir(/home/zhijian/gitweb): Permission denied,但gitweb文件夹上的权限已设置为755。有没有人知道是什么原因导致了这个问题?
发布于 2013-01-27 21:18:49
gitweb cgi必须与您正在扫描的repo拥有相同的所有者。也就是说,如果您的数据是www- $projectroot :www-data,那么gitweb.cgi也必须是www-data:www-data。
此外,$projectroot下的目录也必须具有相同的权限。您应该能够执行chown -R www-data:www-data .,这应该会有所帮助。您将希望查看权限和所有权,但这更棘手,您需要确保它是正确的并且没有打开任何安全漏洞。
发布于 2013-08-31 11:35:09
我在OpenSuse 11.4中也遇到了同样的问题。在我的例子中(我怀疑这就是最初的发帖者的情况,他也是一名opensuse用户),问题最终被证明是AppArmor的事情,我对它知之甚少。
以下是我注意到的最终解决方案的一些要点:
..。
/srv/git/ r,
/srv/git/** r,..。
将它们更改为包含git存储库的父文件夹的路径,例如,如果您将它们存放在"/home/myname/srv/git/",中,则使用""/home/myname/srv/“父文件夹,例如:
..。
/home/myname/srv r,
/home/myname/srv/** r,..。
现在一切都应该很好了:)
发布于 2012-05-16 17:31:43
我也有同样的问题。"404找不到项目“,但配置很好。Apache缓存了404响应,并且没有再次运行cgi脚本:
未编辑火狐中的
<代码>G213
https://stackoverflow.com/questions/10275536
复制相似问题