Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
Check your error log. –  Martin Fjordvald Jan 10 '11 at 16:26

1 Answer 1

up vote 3 down vote accepted

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;
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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