5

我正在尝试在 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>

访问:

<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 或不指定来访问索引页面。但是在那种情况下,当我点击一个 repo 时,它会尝试在 gitlist 目录下找到 repo:

The requested URL /gitlist/testing.git/ was not found on this server.

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

4

1 回答 1

1

我终于设法测试了 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>

(来自我自己的提交这个设置

注意:

  • 这是为了在自己的子目录中运行 gitlist :(https://myServer/gitlist不仅仅是https://myserver
  • 它不会在 git repo 的子目录下显示任何文件:请参阅Issue 250,补丁正在等待中
于 2013-02-12T12:41:19.250 回答