我正在尝试在CentOS Linux上设置gitlist(以防万一,请放心使用gitolite -我已放宽了对由gitolite管理的 repo 目录的权限)。

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

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

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中的虚拟主机指令:
<VirtualHost *:80>
  DocumentRoot /var/www/html
  ServerName sub.example.com
  <Directory "/var/www/html">
    AllowOverride All
    Options -Indexes
  </Directory>
</VirtualHost>

htaccess:
<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,则将正确显示存储库列表(显然)。当我单击其中一个存储库时,尝试执行git时出了点问题。我得到:
Whoops, looks like something went wrong.

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

如果我从.htaccess中删除了重写规则,则可以通过指定index.php或不指定index.php来访问索引页面。但是在这种情况下,当我单击一个存储库时,它将尝试在gitlist目录下找到该存储库:
The requested URL /gitlist/testing.git/ was not found on this server.

有人可以帮忙解决这个烂摊子吗?

最佳答案

我终于设法测试了gitlist。

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

# 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>

(来自my own committhis setup)

注意:
  • 这是用于在自己的子目录中运行gitlist的:https://myServer/gitlist(而不仅仅是https://myserver)
  • 它不会在git repo的子目录下显示任何文件:见Issue 250,补丁正在等待
  • 关于gitlist无法获得存储库列表以外的任何内容,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14166702/

    10-13 05:40