5

CentOS Linuxでgitlistをセットアップしようとしています(問題が発生した場合に備えてgitoliteを使用します-gitoliteによって管理されるリポジトリディレクトリの権限を緩和しました)。

今日、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にアクセスすると、(どうやら) リポジトリ リストが適切に表示されます。リポジトリの 1 つをクリックすると、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.

誰かがこの混乱を整理するのを手伝ってくれませんか?

4

1 に答える 1

1

I finally managed to test gitlist.

I removed the .htaccess, and kept the following config in 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>

(From my own commit, and this setup)

Note that:

  • this is for running gitlist in its own subdirectory: https://myServer/gitlist (not just https://myserver)
  • It won't display any files under a subdirectory within a git repo: see Issue 250, the patch is pending
于 2013-02-12T12:41:19.250 に答える