From 5c43c57af9556b638343b1712a2ac885225cb8ce Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 27 Mar 2013 08:47:56 -0400 Subject: [PATCH] posts:nginx: Export HOME=/ to spawn-fcgi process for gitweb Since Git's 96b9e0e (config: treat user and xdg config permission problems as errors, 2012-10-13), `git` dies with: fatal: unable to access '/root/.config/git/config': Permission denied when it doesn't have access to the HOME directory where it think's its config files are stored. Running an strace shows: access("/root/.config/git/config", R_OK) = -1 EACCES (Permission denied) Since this error is fatal, we need to set the HOME environment variable to somewhere where the server process (the `nginx` user on my box) *does* have access. Regardless of the user, `HOME=/` should be pretty safe ;). --- posts/Nginx.mdwn | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/posts/Nginx.mdwn b/posts/Nginx.mdwn index df71fef..bb2fb8b 100644 --- a/posts/Nginx.mdwn +++ b/posts/Nginx.mdwn @@ -84,7 +84,8 @@ Configure `spawn-fcgi` to launch `fcgiwrap` with: FCGI_USER=nginx FCGI_GROUP=nginx FCGI_EXTRA_OPTIONS="-M 0700" - ALLOWED_ENV="PATH" + ALLOWED_ENV="PATH HOME" + HOME=/ FCGI_CHILDREN=1 FCGI_CHROOT= # cd /etc/init.d/ -- 2.26.2