我在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";
Run Code Online (Sandbox Code Playgroud)
/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>
Run Code Online (Sandbox Code Playgroud)
我在gitweb文件夹中添加了一个软链接来链接gitweb.cgi和静态文件夹.Apache错误日志显示gitweb.cgi: Can't opendir(/home/zhijian/gitweb): Permission denied,但gitweb文件夹的权限已设置为755.是否有人知道可能导致此问题的原因?
Gur*_*rce 12
我在OpenSuse 11.4中也遇到了同样的问题.在我的情况下(我怀疑这是最初的海报的情况,谁也是一个开放的用户),问题结果是这个AppArmor的事情,我知道的很少.
以下是我注意到的最终解决方案:
...
/srv/git/ r,
/srv/git/** r,
Run Code Online (Sandbox Code Playgroud)
...
...
/home/myname/srv r,
/home/myname/srv/** r,
Run Code Online (Sandbox Code Playgroud)
...
一切都应该没事了:)
gitweb cgi必须与您正在扫描的repo拥有相同的所有者.也就是说,如果您的$ projectroot是www-data:www-data,那么gitweb.cgi也必须是www-data:www-data.
此外,$ projectroot下的目录也必须具有相同的权限.你应该能够做一个chown -R www-data:www-data .应该有帮助的人.你会想看看权限和所有权,但这更棘手,你要确保你做对了,没有打开任何安全漏洞.
| 归档时间: |
|
| 查看次数: |
20366 次 |
| 最近记录: |