2013-01-04 66 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',這與我的原始問題/問題不相關。 –

相關問題