我正在尝试在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,存储库列表(显然)会正确显示。当我点击其中一个repos时,当它试图执行时出现问题,git。我明白了:
Whoops, looks like something went wrong.
1/1 RuntimeException: Unknown option: -c
(std git usage message omitted)
如果我从.htaccess中删除重写规则,我可以通过指定index.php来访问索引页面。但是在那种情况下,当我点击一个仓库时,它会尝试在gitlist目录下找到repo:
The requested URL /gitlist/testing.git/ was not found on this server.
有人可以帮忙解决这个烂摊子吗?
答案 0 :(得分: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>
请注意:
https://myServer/gitlist
(不只是https://myserver
)