看不到存储库
安装了 GitWeb 和 CGit 以试用我的 Git/Gitosis 存储库的 Web 界面。在 Fedora 13 上运行,我的 Gitosis 运行良好。我安装了 gitweb 和 cgit 并将配置设置为指向我的存储库,但 gitweb 或 cgi 都不会列出存储库。 Gitweb 显示 gitweb 页面,但显示:
404 - 未找到项目
我在 /etc/gitweb.conf 文件中列出了正确的目录:
$projectroot = "/var/lib/gitosis/repositories";
$projects_list = "/var/lib/gitosis/gitosis/projects.list";
$export_ok="";
$strict_export = "true";
Cgit 显示了 cgit 页面,但显示:
不是 git 存储库: '/var/lib/gitosis/repositories/code/test.git'
当我单击此测试存储库链接时,会出现 (是的,它存在)。我有正确的目录 在 /etc/cgitrc 文件中列出:
repo.url=Test Repo
repo.path=/var/lib/gitosis/repositories/code/test.git
repo.desc=master test repository
repo.owner=gitosis@gitserv
repo.readme=info/web/about.html
因为两者都没有列出存储库,所以我觉得它一定是我的配置,但我似乎不知道要配置什么才能显示这些存储库。我的存储库符号链接在 /var/lib/gitosis/repositories 中,它指向目录 /home/git。我还在 /var/lib/gitosis/repositories 下设置了我的存储库作为代码、conf 和文档,您可以使用 code/test.git 或 conf/test.git 或 docs/test.git 查看它们。我认为这可能是问题所在,并将存储库直接复制到 /var/lib/gitosis/repositories 目录中,但它们仍然没有显示。请任何人指出我可以尝试使其正常工作的任何内容。已经搞了好几天了
Installed GitWeb and CGit to tryout web interfaces to my Git/Gitosis repositories. Runing on Fedora 13 and my Gitosis is working great. I installed gitweb and cgit and setup the configs to point to my repositories but neither gitweb or cgi will list the repositories. Gitweb shows the gitweb page but shows:
404 - No projects found
I have the proper directory listed in the /etc/gitweb.conf file of:
$projectroot = "/var/lib/gitosis/repositories";
$projects_list = "/var/lib/gitosis/gitosis/projects.list";
$export_ok="";
$strict_export = "true";
CGit shows the cgit page but shows:
Not a git repository:
'/var/lib/gitosis/repositories/code/test.git'
when I click on this test repository link (yes it exists). I have the proper directory
listed in the /etc/cgitrc file of:
repo.url=Test Repo
repo.path=/var/lib/gitosis/repositories/code/test.git
repo.desc=master test repository
repo.owner=gitosis@gitserv
repo.readme=info/web/about.html
Because both do not list the repositories I feel it must be my configuration but I can not seem to figure out what to config to get these to display. I have my repositories SymLinked in /var/lib/gitosis/repositories which points to a directory /home/git. I also have my repositories set under /var/lib/gitosis/repositories as code and conf and docs which you check out with code/test.git or conf/test.git or docs/test.git. I thought this might be the problem and copied the repos directly into /var/lib/gitosis/repositories dir but they still did not display. Please can anyone point me at anything I can try to get this working. Been at it for days.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
由于这些存储库实际上位于您的主目录内,因此可能是权限问题。也许您的主页被
chmod
设置为无法被“其他人”读取?这些存储库目录(在您的家中,而不是符号链接)的权限是否足够宽以允许网络服务器看到它们?为了让网络服务器查看您的存储库,网络服务器不能读取存储库的完整路径和存储库本身,并且网络服务器需要将目录设置为
r+x
。使用一些
ls -la
来查看权限,并使用良好的判断来使用chmod
。或者,可能更好...只需将存储库移至其他位置,例如
/opt
或/gitrepo
,并在那里正确设置权限。我之所以这么建议,是因为有充分的理由说明为什么您的主页不应该是世界可读的。Since these repositories are actually inside your home directory, it may be a matter of permissions. Maybe your home is
chmod
ded not to be readable by "others"?Are the permissions for those repositories' directories (in your home, not the symlinks) wide enough to allow the webserver to see them? For the webserver to see your repositories, the full path to the repository and the repositories themselves bust be able to be read by the webserver, and the directories need to be
r+x
by the webserver.Use some
ls -la
to see the permissions, andchmod
using good judgement.Or, probably better... just move the repositories somewhere else like
/opt
or/gitrepo
, and set the permissions correctly there. I am suggesting this as there are good reasons why your home should not be world-readable.请注意,主目录的问题很可能是由于启用了 SELinux。尝试在 /etc/sysconfig/selinux 中禁用。
Just a note, the issue with the home directory is very likely due to SELinux being enabled. Try disabling in /etc/sysconfig/selinux.