2013-01-04 30 views
5

我正在尝试在CentOS Linux上安装gitlist(在gitolite遇到问题时 - 我放宽了gitolite管理的repo目录的权限)。gitlist无法获取仓库列表以外的任何东西

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

我的config.ini文件看起来是这样的:在httpd.conf

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 

虚拟主机的指令:

<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或不访问索引页。但是当我点击回购这种情况下,它试图找到gitlist目录下的回购:

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

是否有人可以帮助解决这个烂摊子?

+0

为什么重写?把你的gitlist webapp放在任何你想要的地方,声明一个别名和一个目录,它应该就足够了(如https://github.com/VonC/compileEverything/blob/master/apache/env.conf.tpl#L41-L93 ) – VonC

+0

重写是应用程序的一部分(它附带一个包含它的.htaccess)。我不知道它为什么在那里。正如我所指出的那样,我没有尝试过,而且我仍然遇到问题。你是说如果我把它移到我的web目录之外,问题就会消失吗? –

+0

我只是指出其他技术来引用一个web应用程序,而不必使用重写。我将不得不测试gitlist,看看它是否也能这样工作。 – VonC

回答

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> 

(从my own committhis setup

需要注意的是:

  • 这是运行gitlist在其自己的子目录中:https://myServer/gitlist(不只是https://myserver
  • 它不会显示任何文件在一个git仓库的子目录下:见Issue 250,该补丁正在申请中
+0

VonC感谢您的努力。我的主要问题实际上是围绕着我提到的未知选项错误,我通过更新我的git可执行文件来解决这个问题。当我尝试访问我的repo时,仍然出现错误,但该错误是'不是git存储库(或任何父目录):.git',这与我的原始问题/问题不相关。 –

相关问题