首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >gitlist不能获得存储库列表之外的任何内容。

gitlist不能获得存储库列表之外的任何内容。
EN

Stack Overflow用户
提问于 2013-01-04 23:27:39
回答 1查看 6.4K关注 0票数 5

我正在尝试在CentOS Linux上设置gitlist (如果有问题的话-我已经放宽了对gitolite管理的回购目录的权限)。

我从gitlist.org中提取了今天的0.3tarball版本。

我的config.ini看起来是这样的:

代码语言:javascript
复制
client = '/usr/bin/git' ; Your git executable path
repositories = '/home/gitolite/repositories/' ; Path to your repositories

[app]
debug = true    
; I don't know if baseurl is still needed..seems like my results are the same either way
baseurl = 'http://sub.example.com.com/gitlist' ; Base URL of the application

Httpd.conf中的虚拟主机指令:

代码语言:javascript
复制
<VirtualHost *:80>
  DocumentRoot /var/www/html
  ServerName sub.example.com
  <Directory "/var/www/html">
    AllowOverride All
    Options -Indexes
  </Directory>
</VirtualHost>

htaccess:

代码语言:javascript
复制
<IfModule mod_rewrite.c>
  Options -MultiViews

  RewriteEngine On
  RewriteBase /var/www/html/gitlist/

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ index.php [L,NC]

  AuthName "Git List"
  AuthType Basic
  AuthUserFile /var/www/.gitlistpwds
  Require valid-user

</IfModule>
<Files config.ini>
  order allow,deny
  deny from all
</Files>

使用此设置,转到http://sub.example.com/gitlist将导致浏览器错误消息,说明/index.php不存在(也就是说,它试图转到/var/www/html/index.php )。

在这种情况下,如果我转到http://sub.example.com/gitlist/index.php,存储库列表(显然)就会正确地出现。当我点击其中一个repos时,当它尝试执行时会出错,git。我得到:

代码语言:javascript
复制
Whoops, looks like something went wrong.

1/1 RuntimeException: Unknown option: -c
(std git usage message omitted)

如果从.htaccess中删除重写规则,则可以通过指定index.php或不指定索引页来访问索引页。但在这种情况下,当我单击回购时,它试图在gitlist目录下找到repo:

代码语言:javascript
复制
The requested URL /gitlist/testing.git/ was not found on this server.

谁能帮我收拾一下这个烂摊子吗?

EN

回答 1

Stack Overflow用户

发布于 2013-02-12 12:41:19

我终于成功地测试了gitlist。

我删除了.htaccess,并在httpd.conf中保留了以下配置:

代码语言:javascript
复制
# GitList on 28473
<IfModule !php5_module>
  LoadModule php5_module modules/libphp5.so
</IfModule>
Listen 28473
<VirtualHost aserver.prod.fr.company:28473>
    ServerName aserver.prod.fr.company
    ServerAlias aserver
    SSLCertificateFile "/home/vonc/apache/crt"
    SSLCertificateKeyFile "/home/vonc/apache/key"
    SSLEngine on
    SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
    SetEnv GIT_HTTP_BACKEND "/home/vonc/usr/local/apps/git/libexec/git-core/git-http-backend"
    DocumentRoot /home/vonc/gitlist/github
    Alias /gitlist /home/vonc/gitlist/github
    <FilesMatch "\.(cgi|shtml|phtml|php)$">
      SSLOptions +StdEnvVars
    </FilesMatch>
    <FilesMatch ".php$">
      SetHandler application/x-httpd-php
    </FilesMatch>
    <FilesMatch ".phps$">
      SetHandler application/x-httpd-php-source
    </FilesMatch>
    <Directory /home/vonc/gitlist/github>
        SSLOptions +StdEnvVars
        Options ExecCGI +Indexes +FollowSymLinks
        AllowOverride All
        order allow,deny
        Allow from all
        Options -MultiViews

        DirectoryIndex index.php
        RewriteEngine On

        RewriteBase /home/vonc/gitlist/github/
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^(.*)$ gitlist/index.php/$1 [L,NC]

    </Directory>

    # RewriteLog "/home/vonc/gitlist/logs/apache_gitlist_rewrite_log"
    # RewriteLogLevel 3
    CustomLog "/home/vonc/gitlist/logs/apache_gitlist_ssl_request_log" \
              "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
    ErrorLog "/home/vonc/gitlist/logs/apache_gitlist_error_log"
    TransferLog "/home/vonc/gitlist/logs/apache_gitlist_access_log"
    LogLevel info
</VirtualHost>

(来自我自己的承诺这个设置)

请注意:

  • 这是为了在它自己的子目录中运行gitlist:https://myServer/gitlist (而不仅仅是https://myserver)
  • 它不会在git中的子目录下显示任何文件:请参阅第250期,修补程序正在挂起
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14166702

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档