4

I have a git repository in a directory inside of /home/raynes/pubgit/. I'm trying to use gitweb to provide a web interface to it. I use nginx as my web server for everything else, so I don't really want to have to use another just for this.

I'm mostly following this guide: http://michalbugno.pl/en/blog/gitweb-nginx, which is the only guide I can find via google and is really recent. fcgiwrap apparently isn't in Lucid Lynx's repositories, so I installed it manually. I spawn instances via spawn-fcgi:

spawn-fcgi -f /usr/local/sbin/fcgiwrap -a 127.0.0.1 -p 9001

That's all good. My /etc/gitweb.conf is as follows:

# path to git projects (<project>.git)
$projectroot = "/home/raynes/pubgit";
$my_uri = "http://mc.raynes.me";
$home_link = "http://mc.raynes.me/";

# directory to use for temp files
$git_temp = "/tmp";

# target of the home link on top of all pages
#$home_link = $my_uri || "/";

# html text to include at home page
$home_text = "indextext.html";

# file with project list; by default, simply scan the projectroot dir.
$projects_list = $projectroot;

# stylesheet to use
$stylesheet = "/gitweb/gitweb.css";

# logo to use
$logo = "/gitweb/git-logo.png";

# the 'favicon'
$favicon = "/gitweb/git-favicon.png";

And my nginx server configuration is this:

server {
    listen 80;
    server_name mc.raynes.me;
    location / {
        root /usr/share/gitweb;
        if (!-f $request_filename) {
            fastcgi_pass   127.0.0.1:9001;
        }
        fastcgi_index  index.cgi;
        fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        include        fastcgi_params;
    }
}

The only difference here is that I've set fastcgi_pass to 127.0.0.1:9001. When I go to http://mc.raynes.me I'm greeted with a page that simply says "403" and nothing else. I have not the slightest clue what I did wrong.

Any ideas?

3

Ensure that your SCRIPT_FILENAME is correct. I've found that I have to specify the full absolute location to get it work:

fastcgi_param  SCRIPT_FILENAME  /usr/share/gitweb/gitweb.cgi;

If you continue to have errors, you may need to specify the full path to your Gitweb configuration file as well:

fastcgi_param  GITWEB_CONFIG    /etc/conf.d/gitweb.conf;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.