gitcentos7gitweb

Gitweb - 404 - No projects found


I have a DigitalOcean droplet with Centos 7 but I can't see my repos on my droplet.

I have a user git and inside the respective home folder I have the folder "projects": /home/git/projects

Inside that folder is a test repo initialized with: git init --bare

Here is my gitweb.conf

$projectroot = "/home/git/projects";
$git_temp = "/tmp";
$home_link = $my_uri || "/";
$home_text = "indextext.html";
$projects_list = $projectroot;

Here my sites-availables file:

server {
        listen       80;
        server_name  git.apselom.com;

        access_log /var/log/nginx/git.apselom.com.access_log main;
        error_log /var/log/nginx/git.apselom.com.error_log info;

        location /gitweb.cgi {
                root /var/www/git/;
                include fastcgi_params;
                gzip off;
                fastcgi_param SCRIPT_NAME $uri;
                fastcgi_param GITWEB_CONFIG /etc/gitweb.conf;
                fastcgi_pass  unix:/var/run/fcgiwrap.socket;
        }
    location / {
                root /var/www/git/;
                index gitweb.cgi;
        }
}

With those, I only get the error: 404 - No projects found.


Solution

  • I suspect the problem is that the user your web server is running as is unable to access your git repositories.

    What's odd is that you said you're using CentOS 7, but CentOS 7 ships with Apache httpd, and what you have their looks like a Lighttpd configuration. The gitweb package for CentOS ships with an Apache configuration file, so that using it is basically:

    And you're good to go:

    $ links http://localhost/git/
    [...]
       Project            Description             Owner   Last Change                                  
       project1 Unnamed repository; edit this... git user No commits  summary | shortlog | log |       
                                                                      tree                             
       project2 Unnamed repository; edit this... git user No commits  summary | shortlog | log |       
                                                                      tree                             
    

    The key part, though, is ensuring that your web server has appropriate permissions on your /home/git directory. If you're not using Apache, figure out what user your web server is using and then substitute that in the above.