在debian(基于系统)上为git-http-backendconfigurationnginx

我在使用我的Ubuntu 13.04机器上的nginx服务器时,遇到了麻烦,无法使用githttp-backend。 之前用Debian 7试过,但结果相似。 基本上我遵循http://weininger.net/configuration-of-nginx-for-gitweb-and-git-http-backend/,但忽略任何有关gitweb。

我做了以下几点:

安装nginx,git,git-core和fcgiwrap使用:

apt-get install git git-core nginx fcgiwrap 

在/var/git/test.git创build一个裸回购,并将其变为www-data:

 mkdir -p /var/git/test.git cd /var/git/test.git git init --bare git update-server-info chown -R www-data:www-data /var/git 

用/ etc / nginx / sites-enabled / defaultreplace

 server { listen 80; server_name localhost; location / { root /var/git; fastcgi_pass unix:/var/run/fcgiwrap.socket; fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend; fastcgi_param PATH_INFO $uri; fastcgi_param GIT_PROJECT_ROOT /var/git; fastcgi_param GIT_HTTP_EXPORT_ALL ""; include /etc/nginx/fastcgi_params; } } 

当做

 GIT_CURL_VERBOSE=1 git clone http://localhost/test.git 

它打印:

 Klone nach 'test'... * Couldn't find host localhost in the .netrc file; using defaults * About to connect() to localhost port 80 (#0) * Trying 127.0.0.1... * Connected to localhost (127.0.0.1) port 80 (#0) > GET /test.git/info/refs?service=git-upload-pack HTTP/1.1 User-Agent: git/1.8.1.2 Host: localhost Accept: */* Accept-Encoding: gzip Pragma: no-cache * The requested URL returned error: 500 Internal Server Error * Closing connection 0 error: The requested URL returned error: 500 Internal Server Error while accessing http://localhost/test.git/info/refs?service=git-upload-pack fatal: HTTP request failed 

/var/log/nginx/error.log不包含此请求的任何条目。 我不知道如果git-http-backend写入一个日志文件,但找不到一个。

你有什么想法这个设置有什么问题吗? 你知道一个获得更多的关于500错误信息/日志logging的方法吗?

由于您收到500错误:

 500 Internal Server Error while accessing http://localhost/test.git/info/refs?service=git-upload-pack 

在浏览nginx错误日志的同时,试着在浏览器中访问这个地址。 您可以通过以下方式查看错误日志“交互式”:

 tail -f /var/log/nginx/error.log